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

  1. Copy NotificationSDKClient.aar from the OneSpan Mobile Security Suite package to your project.

  2. Add the Google Play services project as a dependent library.

    For more information, refer to https://firebase.google.com/docs/android/setup.

  3. Configure your manifest to be able to receive a notification.

    AndroidManifest.xml

    1. <application>
    2.   <activity android:name="ActivityName">

    3.   ...

    4. <!-- This intent filter is used to select the activity that

    5. will be launched when the user clicks on a notification.

    6. The MIME type is customizable. Make sure it matches the

    7. “notificationMIMEType” property in the assets/onespan-notifications.properties

    8. file. -->

    9.     <intent-filter>

    10.       <action android:name="android.intent.action.VIEW"/>

    11.       <category android:name=        "android.intent.category.DEFAULT"/>

    12.       <data android:mimeType=        "application/vnd.com.vasco.notification.NOTIFICATION_         ACTIVITY"/>

    13.     </intent-filter>

    14.   </activity>

    15.   <meta-data

         android:name="com.google.android.gms.version"

         android:value="@integer/google_play_services_version"/>

    16. </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.

  4. 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:

    Properties in the onespan-notifications.properties file
    Key Mandatory Description
    notificationMIMEType ü Mime type that is used when a notification is received. This must be the same value as the one specified in the manifest.
    notificationIconName ü Icon displayed in the notification center when a notification is received. This icon file must be in a .png format and must be added as a resource.
    notificationIconNameLollipop   Icon displayed in the notification center when a notification is received. This property is used on Android 5.0 and later. The icon can only be white and transparent, must be in a .png format and must be added as a resource.
    notificationIconBackgroundColorLollipop  

    Background color used for the notification icon when a notification is displayed on the notification drawer. This property is used on Android 5.0 and later. Supported formats are:

    • #RRGGBB
    • #AARRGGBB,
    • or you can use the following color terms:

      red, blue, green, black, white, gray, cyan, magenta, yellow, lightgray, darkgray, grey, lightgrey, darkgrey, aqua, fuchsia, lime, maroon, navy, olive, purple, silver, teal.

    notificationOpenInForeground   Optional Boolean switching behavior of the notifications that are received while the application is in foreground. Default value: false.

    onespan-notifications.properties:

    1. notificationMIMEType=application/vnd.com.vasco.notification.NOTIFICATION_ACTIVITY
    2. notificationIconName=ic_notification.png
    3. notificationIconNameLollipop=ic_notification_lollipop.png

    4. notificationIconBackgroundColorLollipop=#848484

    5. notificationOpenInForeground=true
  5. 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.

Integrating the Notification SDK Client (Android)

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

  1. Link MSSNotificationClient.xcframework from the OneSpan Mobile Security Suite package to your Xcode project (linked framework and libraries).
  2. 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) .

  3. 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.

Integrating the Notification SDK Client (Android)

Integrate the Notification SDK Client (iOS)