Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
onesignal-expo-plugin
Advanced tools
The OneSignal Expo plugin allows you to use OneSignal without leaving the managed workflow. Developed in collaboration with SweetGreen.
The OneSignal Expo plugin allows you to use OneSignal without leaving the managed workflow. Developed in collaboration with SweetGreen.
This plugin is an Expo Config Plugin. It extends the Expo config to allow customizing the prebuild phase of managed workflow builds (no need to eject to a bare workflow). For the purposes of OneSignal integration, the plugin facilitates automatically generating/configuring the necessary native code files needed to get the OneSignal React-Native SDK to work. You can think of adding a plugin as adding custom native code.
expo run:[android|ios]
)expo install onesignal-expo-plugin
# npm
npm install react-native-onesignal
# yarn
yarn add react-native-onesignal
Add the plugin to the front of the plugin array. It should be added automatically if you ran expo install
. Just make sure it is the first plugin in the array and to configure any desired plugin props:
app.json
{
"plugins": [
[
"onesignal-expo-plugin",
{
"mode": "development",
}
]
]
}
or
app.config.js
export default {
...
plugins: [
[
"onesignal-expo-plugin",
{
mode: "development",
}
]
]
};
You can pass props to the plugin config object to configure:
Plugin Prop | ||
---|---|---|
mode | required | Used to configure APNs environment entitlement. "development" or "production" |
devTeam | optional | Used to configure Apple Team ID. You can find your Apple Team ID by running expo credentials:manager e.g: "91SW8A37CR" |
iPhoneDeploymentTarget | optional | Target IPHONEOS_DEPLOYMENT_TARGET value to be used when adding the iOS NSE. A deployment target is nothing more than the minimum version of the operating system the application can run on. This value should match the value in your Podfile e.g: "12.0" . |
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);
Alternatively, pass the app ID directly to the function:
OneSignal.setAppId("YOUR-ONESIGNAL-APP-ID");
In your configuration file, make sure you set:
Property | Details |
---|---|
version | Your app version. Corresponds to CFBundleShortVersionString on iOS. This value will be used in your NSE* target's plist file. |
ios.buildNumber | Build number for your iOS standalone app. Corresponds to CFBundleVersion and must match Apple's specified format. This value will be used in your NSE* target's plist file. |
* NSE = Notification Service Extension. Learn more about the NSE here.
See our EAS documentation for help with EAS.
To distribute your iOS application via EAS, you will need to ensure your credentials are set up correctly. See our credentials setup guide for instructions.
Prebuilding in Expo will result in the generation of the native runtime code for the project (and ios
and android
directories being built). By prebuilding, we automatically link and configure the native modules that have implemented CocoaPods, autolinking, and other config plugins. You can think of prebuild like a native code bundler.
When you run expo prebuild
we enter into a custom managed workflow which provides most of the benefits of bare workflows and managed workflows at the same time.
It may make sense to prebuild locally to inspect config plugin changes and help in debugging issues.
expo prebuild
# nukes changes and rebuilds
expo prebuild --clean
EAS Note: if you choose to stay in a fully managed workflow by not prebuilding, EAS will still run expo prebuild
at build time. You can also prebuild locally but remain in a fully managed workflow by adding the android
and ios
directories to your .gitignore.
The following commands will prebuild and run your application. Note that for iOS, push notifications will not work in the Simulator.
# Build and run your native iOS project
expo run:ios
# Build and run your native Android project
expo run:android
Contributions, issues and feature requests are welcome!
Feel free to check issues page.
Give a ⭐️ if this project helped you!
1.1.2
- 10/04/22
use_frameworks
on OneSignalNotificationServiceExtension
target in iOS Podfile when applicable (i.e. the app target also specifies use_frameworks
).FAQs
The OneSignal Expo plugin allows you to use OneSignal without leaving the managed workflow. Developed in collaboration with SweetGreen.
The npm package onesignal-expo-plugin receives a total of 8,101 weekly downloads. As such, onesignal-expo-plugin popularity was classified as popular.
We found that onesignal-expo-plugin demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 9 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.