Unity SDK quick start
Get started with the Pushwoosh Unity SDK using this quick and simple example
Prerequisites
Anchor link toTo integrate the Pushwoosh Unity SDK into your app, you will need the following:
Download the example project
Anchor link toClone the example project repository:
git clone git@github.com:Pushwoosh/pushwoosh-unity-sample.git
Configure the project
Anchor link toOpen Assets/PushNotificator.cs and set the Pushwoosh initialization values:
Pushwoosh.ApplicationCode = "XXXXX-XXXXX";Pushwoosh.FcmProjectNumber = "XXXXXXXXXXXX";
Replace the ApplicationCode
and FcmProjectNumber
values with your Pushwoosh App Code and Firebase Project Number.
1. Set the Bundle Identifier
Anchor link toIn the iOS build profile set the Bundle Identifier
to your bundle ID (eg. com.example.pushwoosh
).
2. Install dependencies
Anchor link toAfter completing iOS build navigate to the ios directory and install the dependencies:
pod install
3. Set the API Token
Anchor link toOpen the ios/Unity-iPhone.xcworkspace file in Xcode.
In your ios/Unity-iPhone/Info.plist
set the __PUSHWOOSH_DEVICE_API_TOKEN__
key to the Pushwoosh Device API Token:
<key>Pushwoosh_API_TOKEN</key><string>__PUSHWOOSH_DEVICE_API_TOKEN__</string>
Android
Anchor link to1. Set the package name
Anchor link toIn the Android build profile set the Package Name
to your app’s package name (eg. com.example.pushwoosh
).
2. Setup google-services.json
Anchor link toCopy your google-services.json
file to the Assets
directory
3. Set the API Token
Anchor link toIn your Assets/Plugins/Android/AndroidManifest.xml
add Pushwoosh Device API Token inside the <application>
tag:
<meta-data android:name="com.pushwoosh.apitoken" android:value="__YOUR_DEVICE_API_TOKEN__" />
Important: Be sure to give the token access to the right app in your Pushwoosh Control Panel. Learn more
Run the project
Anchor link to- Build and run the project.
- Tap the “Register for push notifications” button.
- Grant permission for push notifications. The device will be registered with Pushwoosh.
Send a push notification
Anchor link toGo back to the Pushwoosh Control Panel and send a push notification to your registered device.