Repository navigation
docs: write the Expo guide - #903
Merged
Merged
Conversation
The Expo guide was one paragraph about development builds. It now covers @config-plugins/react-native-callkeep, from its source (14.0.2) and from npx expo prebuild on a new Expo SDK 58 app: - what the plugin adds (voip background mode, CallKit; Android permissions, VoiceConnectionService with the phoneCall type, the headless service); - what to add in app.json: the audio background mode and microphone text on iOS, the foreground service permissions and POST_NOTIFICATIONS on Android, and a small local plugin for the phoneCall|microphone service types of the Android guide. Prebuild gives the same manifest with the plugins in either order. Without FOREGROUND_SERVICE_PHONE_CALL, the plugin's setup loses the foreground service on Android 14+: the example app built with the plugin's manifest logs "Can't start foreground service: SecurityException: Starting FGS with type phoneCall ... requires permissions" on a Galaxy S24 with Android 16. Plugins before 13.0.0 (Expo SDK 54 and earlier) don't add RECORD_AUDIO, which CallKeep's managed mode checks: the cause of #621. Based on #849 by sultanmyrza. Co-authored-by: sultanmyrza <sultanmyrza@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #621. Takes over #849 by @sultanmyrza, which added Expo instructions to the README; the documentation has since moved to
docs/, so they go todocs/guides/expo.md, which was one paragraph.Checked against the config plugin
From the source of
@config-plugins/react-native-callkeep14.0.2 andnpx expo prebuildon a new Expo SDK 58 app (React Native 0.88):voipbackground mode and CallKit on iOS; on Android,READ_PHONE_STATE,READ_PHONE_NUMBERS,CALL_PHONE,RECORD_AUDIO,FOREGROUND_SERVICE(andBIND_TELECOM_CONNECTION_SERVICEas auses-permission, which isn't needed),VoiceConnectionServicewith thephoneCalltype only, andRNCallKeepBackgroundMessagingService.READ_PHONE_NUMBERSandRECORD_AUDIOcame with plugin 13.0.0 (Expo SDK 55); 11.0.0 and 12.0.0 don't have them.READ_PHONE_NUMBERSandCALL_PHONEare in CallKeep's own manifest anyway, so the one Add Expo installation and configuration instructions for react-native… #849 and displayIncomingCall ignored due to no ConnectionService or no phone account #621 were missing isRECORD_AUDIO, whichhasPermissions()checks in managed mode: the guide says to add it with SDK 54 and earlier."newArchEnabled": falsefrom displayIncomingCall ignored due to no ConnectionService or no phone account #621 isn't needed: the example app runs on the New Architecture.What the guide adds
audiobackground mode andNSMicrophoneUsageDescription(the plugin only addsvoip).FOREGROUND_SERVICE_PHONE_CALL,FOREGROUND_SERVICE_MICROPHONE,POST_NOTIFICATIONS, and a 25-line local config plugin that givesVoiceConnectionServicethephoneCall|microphonetypes of the Android guide. The plugin doesn't change a service that is already declared, so the local plugin creates it or updates it: prebuild gives one service withphoneCall|microphoneand its intent filter with the two plugins in either order. The guide's exactapp.jsonkeys and plugin code were run through prebuild.Why the permission matters: CallKeep starts its foreground service with the types declared on the service. I built the example app with the manifest the plugin generates (
phoneCall, noFOREGROUND_SERVICE_PHONE_CALL) and answered a call on a Galaxy S24 with Android 16: the call works, but no foreground service runs, and the log showsWith the permission the same build runs the foreground service (
isForeground=true).