The following procedure allows you to integrate and use the Notification SDK Client in your Android project.
To use the Notification SDK Client in your Android project
-
Copy NotificationSDKClient.aar from the OneSpan Mobile Security Suite package to your project.
-
Add the Google Play services project as a dependent library.
For more information, refer to https://firebase.google.com/docs/android/setup.
-
Configure your manifest to be able to receive a notification.
AndroidManifest.xml
- <application>
-
<activity android:name="ActivityName">
-
...
-
<!-- This intent filter is used to select the activity that
-
will be launched when the user clicks on a notification.
-
The MIME type is customizable. Make sure it matches the
-
“notificationMIMEType” property in the assets/onespan-notifications.properties
-
file. -->
-
<intent-filter>
-
<action android:name="android.intent.action.VIEW"/>
-
<category android:name= "android.intent.category.DEFAULT"/>
-
<data android:mimeType= "application/vnd.com.vasco.notification.NOTIFICATION_ ACTIVITY"/>
-
</intent-filter>
-
</activity>
-
<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version"/>
-
</application>
If you target Android 13, you need to declare the POST_NOTIFICATIONS permission in the AndroidManifest.xml of the application.
As of version 4.17.2 of the OneSpan Notification SDK, the library is delivered as an AAR file.
The AAR file embeds an AndroidManifest.xml file; thus less information is required in the AndroidManifest.xml of the application.
-
Create a onespan-notifications.properties file in the assets folder.
This file must contain several properties, each of which has a key/value pair. The key and value are separated by an equal sign (=). For example:
notificationMIMEType=application/vnd.com.vasco.notification.NOTIFICATION_ACTIVITY
Properties in the onespan-notifications.properties file lists the mandatory and optional properties to include in the file:
onespan-notifications.properties:
- notificationMIMEType=application/vnd.com.vasco.notification.NOTIFICATION_ACTIVITY
- notificationIconName=ic_notification.png
-
notificationIconNameLollipop=ic_notification_lollipop.png
-
notificationIconBackgroundColorLollipop=#848484
- notificationOpenInForeground=true
-
Retrieve google-services.json from your Firebase project. This file is mandatory to enable FCM from your Android project. For more information about obtaining this file, see Enable Push Notification in a Google project. This file must be downloaded from your Firebase project:
- Go to Console -> Select Project -> Project Settings and open the General tab.
- Retrieve google-services.json and replace the .json file inside the app sample project repository.
You are now ready to use the Notification SDK Client.
Integrate the Notification SDK Client (Android)
The following procedure allows you to integrate and use the Notification SDK Client in your iOS project.
To use the Notification SDK Client in your iOS project
- Link MSSNotificationClient.xcframework from the OneSpan Mobile Security Suite package to your Xcode project (linked framework and libraries).
-
In your .plist file, add the App downloads content in response to push notifications mode (raw value: <remote-notification>) to the list associated with the Required background modes property (raw value: UIBackGroundModes) .
-
Make sure your application bundle identifier matches that in the provisioning profile that has been created for this specific application with the Remote notifications capability.
You are now ready to use the Notification SDK Client.
Integrate the Notification SDK Client (iOS)