Skip to main content
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.

Register mobile device

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 ID 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:
ArgumentTypeDescription
deviceNameStringRequired. A name of the device that uses a Firebase token.
deviceUuidStringRequired. UUID of the current mobile device.
deviceOsStringRequired. Current mobile device OS.
firebaseTokenStringRequired. 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:
mutation registerMobileDevice {
  registerMobileDevice(deviceData: {
    deviceName: 'iPhone',
    deviceUuid: 'B064943C-B06F-46EF-B262-************',
    deviceOs: 'iOS',
    firebaseToken: 'dTJyESe2iUo9siCCh6pffQ:APA91bGINrL-...'
  }) {
    errors
    response
  }
}

Unregister mobile device

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:
mutation unregisterMobileDevice {
  unregisterMobileDevice(firebaseToken: 'dTJyESe2iUo9siCCh6pffQ:APA91bGINrL-...') {
    errors
    response
  }
}