Opigno Enterprise provides a native mobile application for learners that uses Firebase to send push notifications to Android and iOS devices.
A push notification will be triggered every time when Opigno in-built site notification is created.
If you work on the custom application, Firebase settings should be updated in the backoffice.
To send push notifications, we need to know the information about the mobile device and associated Firebase token.
Opigno Enterprise API provides an endpoint to register mobile devices.
If device already exists (there is a match between a user context UUID and device UUID), an associated token will be updated.To register device, the registerMobileDevice mutation should be executed right after the login.
Mutation has one required argument deviceData that represents the information about the mobile device that is being registered:
Argument
Type
Description
deviceName
String
Required. A name of the device that uses a Firebase token.
deviceUuid
String
Required. UUID of the current mobile device.
deviceOs
String
Required. Current mobile device OS.
firebaseToken
String
Required. A Firebase token assigned to the device to send push notifications.
If the mutation executed without any errors, a boolean value will be returned as a response indicating the success status:
To prevent push notifications from being created when a user is logged out from the application,
should be executed the unregisterMobileDevice mutation. It has one argument - firebaseToken.If the mutation executed without any errors, a boolean value will be returned as a response indicating the success status:
Default lifetime of the Firebase token is 1 hour. Once this time is over, push notifications will not be
delivered to the related device.
To prevent such cases, the token should be updated. To do this, updateFirebaseToken mutation should be executed.
Argument
Type
Description
deviceUuid
String
Required. UUID of the corresponding mobile device.
firebaseToken
String
Required. A new Firebase token that should be assigned to the device.
If the mutation executed without any errors, a boolean value will be returned as a response indicating the success status: