The OneSignal Expo plugin allows you to use OneSignal without leaving the managed workflow. Developed in collaboration with SweetGreen.
🏠 Homepage
🖤 npm
expo install onesignal-expo-plugin
Add the plugin to the plugin array:
app.json
{
"plugins": [
[
"onesignal-expo-plugin",
{
"mode": "development"
}
]
]
}
or
app.config.js
export default {
...
plugins: [
[
"onesignal-expo-plugin",
{
mode: process.env.NODE_ENV || "development"
}
]
]
};
mode
: used to configure APNs environment entitlement."development"
"production"
Add your OneSignal App ID to your Expo constants via the extra
param:
Example:
{
"extra": {
"oneSignalAppId": "<YOUR APP ID HERE>"
}
}
You can then access the value to pass to the setAppId
function:
import OneSignal from 'react-native-onesignal';
import Constants from "expo-constants";
OneSignal.setAppId(Constants.manifest.extra.oneSignalAppId);
Contributions, issues and feature requests are welcome!
Feel free to check issues page.
Give a ⭐️ if this project helped you!
- Website: https://onesignal.com
- Twitter: @onesignal
- Github: @OneSignal
- LinkedIn: @onesignal