Expo SDK quick start
Get started with the Pushwoosh Expo SDK using this quick and simple example
Prerequisites
Section titled “Prerequisites”To integrate the Pushwoosh Expo SDK into your app, you will need the following:
Download the example project
Section titled “Download the example project”# Clone the SDK repository and navigate to the example projectgit clone https://github.com/Pushwoosh/pushwoosh-expo-plugin-sample.git
# Navigate to example directorycd pushwoosh-expo-plugin-sample/
Configure the project
Section titled “Configure the project”1. Install the dependencies:
Section titled “1. Install the dependencies:”npm install
2. Initialize Pushwoosh
Section titled “2. Initialize Pushwoosh”Open app/_layout.tsx and update the Pushwoosh.init call:
Pushwoosh.init({ pw_appid: "__YOUR_APP_CODE__", project_number: "__YOUR_FCM_SENDER_ID__" });
Where:
__YOUR_APP_CODE__
is the application code from the Pushwoosh Control Panel. __YOUR_FCM_SENDER_ID__
is the Firebase project number from the Firebase Console.
3. Set the package name and bundle ID
Section titled “3. Set the package name and bundle ID”Open app.json and set:
package
to your app’s package name.bundleIdentifier
to your app’s bundle ID.
4. Set the Pushwoosh Device API token
Section titled “4. Set the Pushwoosh Device API token”Open your app.json file and set Pushwoosh Device API Token for both platforms:
PW_API_TOKEN
device API token value for iOS platform.apiToken
device API token value for Android platform.
Prebuild the app
Section titled “Prebuild the app”npx expo prebuild
Prepare iOS platform
Section titled “Prepare iOS platform”- Install the dependencies:
cd ios/ && pod install
- Open xcworkspace file in Xcode.
- Sign the app in the “Signing & Capabilities” tab.
Build and run the project
Section titled “Build and run the project”Android:
npx expo run:android
iOS:
npx expo run:ios
Send a push notification
Section titled “Send a push notification”Go back to the Pushwoosh Control Panel and send a push notification to your registered device.