Class CefriumRelayTransport
java.lang.Object
com.cefrium.CefriumPushTransport
com.cefrium.CefriumRelayTransport
Web Push through the app's own Firebase project and a cefrium-relay the app
developer runs, instead of the Chromium channel Google provides for testing.
CefriumPush.setTransport(new CefriumRelayTransport(
"https://push.example.com", "<public key printed by cefrium-relay keygen>"));
The relay keeps no state. Each endpoint carries the subscription (the
app's FCM token, the page's VAPID key), encrypted on the device to the
relay's public key. The relay checks the sender's VAPID signature and sends
the message, still encrypted for the page, through FCM; CefriumPushService or the app's own service passes it to CefriumPush.handleMessage(Context, String, Bundle). Pages must subscribe with an
applicationServerKey.
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
CefriumRelayTransport
-
-
Method Details
-
subscribe
Description copied from class:CefriumPushTransportRegisters a subscription with the push service. Called off the main thread; may block until the service answers.- Specified by:
subscribein classCefriumPushTransport- Parameters:
appId- identifies the subscription; pass it back toCefriumPush.deliverMessage(Context, String, byte[])with its messages.applicationServerKey- the page's VAPID public key, base64url, or the sender id of a page that subscribed without one.- Returns:
- the https URL that application servers send messages to.
- Throws:
IOException- if the service could not register it.
-
unsubscribe
Nothing to remove: the relay holds no subscriptions.- Specified by:
unsubscribein classCefriumPushTransport
-
getToken
The app's FCM registration token. Called off the main thread.- Throws:
IOException
-