expo run:[android|ios]
)You need both the pushwoosh-expo-plugin
and the pushwoosh-react-native-plugin
npm package.
npx expo install pushwoosh-expo-plugin
# npm
npm install pushwoosh-react-native-plugin
Add the plugin to the front of the plugin array.
{
"plugins": [
[
"pushwoosh-expo-plugin",
{
"mode": "development",
}
]
]
}
You can pass props to the plugin config object to configure:
Plugin props | ||
---|---|---|
mode |
required | Used to configure APNs environment entitlement. "development" or "production" |
import Pushwoosh from 'pushwoosh-react-native-plugin';
Pushwoosh.init({
"pw_appid" : "YOUR_PUSHWOOSH_PROJECT_ID" ,
"project_number" : "YOUR_GCM_PROJECT_NUMBER"
});
Pushwoosh.register();
See Pushwoosh React Native integration
Prebuilding within Expo entails the generation of native runtime code for the project, resulting in the construction of the 'ios' and 'android' directories. Through prebuilding, the native modules that utilize CocoaPods, autolinking, and other configuration plugins are automatically linked and configured. You can conceptualize prebuild as a bundler for native code.
Executing expo prebuild initiates a custom managed workflow that combines the advantages of both bare workflows and managed workflows simultaneously.
Why is prebuilding recommended?
Prebuilding locally can be beneficial for inspecting changes in config plugins and assisting in the debugging of issues.
npx expo prebuild
Executing the provided commands will prebuild and run your application. It's important to note that push notifications will not function in the iOS Simulator.
# Build and run your native iOS project
npx expo run:ios
# Build and run your native Android project
npx expo run:android