Integrate the Notification SDK Server

Prev Next

Java

The Notification SDK Server requires Java 8.

To use the Notification SDK Server sample in your Java project

  1. Link the libraries from the OneSpan Mobile Security Suite package to your project’s classpath.

  2. In NotificationSDKServerSample.java, replace the following variables according to your device:

    Android

    • Adjust the ANDROID_VASCO_NOTIFICATION_IDENTIFIER variable to set up the OneSpan Notification Identifier for your device. You can retrieve it from your client sample integration after the notification service registration.

    • Adjust the ANDROID_PROJECT_KEY variable to set up your Android project key (API key). You can retrieve it from the Google API Console.

    iOS

    • Adjust the IOS_VASCO_NOTIFICATION_IDENTIFIER variable to set up the Notification Identifier for your device. You can retrieve it from your client sample integration after the notification service registration.

    • Update the Boolean variable IOS_USE_DEVELOPMENT_SERVER as needed. Note that this also depends on the used PKCS #8 key.

    • Adjust the IOS_P8_KEY_PATH variable to set up the path of your PKCS #8 key.

    • Adjust the IOS_KEY_ID variable to set up the password of your PKCS #8 key.

    • Adjust the IOS_TEAM_ID variable to set up the identifier of the team that is responsible for the creation of the PKCS #8 key.

You are now ready to use the Notification SDK Server.

.NET

The Notification SDK Server contains a solution sample to demonstrate how to integrate the SDK in your .NET project. The following procedures describe how to use both the sample and the SDK in your .NET project.

To use the Notification SDK Server Sample .NET project

  • Copy NotificationSDKServer.dll from the OneSpan Mobile Security Suite package in the lib folder.

You are now ready to use the Notification SDK Server sample.

To use the Notification SDK Server in your .NET project

  1. Add a reference to NotificationSDKServer.dll from the OneSpan Mobile Security Suite package to your project.

  2. Add a Nuget package reference to Newtonsoft.Json version 13.0.3.

  3. Add a Nuget package reference to jose-jwt version 4.1.0.

  4. Add a Nuget package reference to FirebaseAdmin version 3.0.1.

You are now ready to use the Notification SDK Server.

The token-based authentication scheme is the only available method to send push notifications to iOS devices.

Modifying the content before displaying the notification

The Notification SDK Server supports the modification of the content before the notification is displayed. On iOS, when the mutable-content property is present in the Notification object's payload, the receiving device can modify the notification content before displaying it by invoking the app's Notification Service Extension.

The addition is backward compatible, its default value is false. For modifying it, getter and setter methods are exposed in the Notification object as follows:

  • Java Server

    • public void setIOSMutableContent(boolean mutableContent)

    • public boolean isIOSMutableContent()

  • .NET Server

    Exposes the default get set as:

    • public bool IOSMutableContent { get; set; }

API reference documentation and sample applications

To learn more about the public APIs and their functions, exceptions, and error codes, refer to the technical documentation that is included in the product package for each SDK and each platform. In the product package, you can also find the sample applications provided for each platform to see examples of how the SDKs can be used.

These sample apps are intended only to demonstrate basic scenarios and SDK usage. They are not designed to be copied directly into production projects!