Slide 14
Slide 14 text
6OJpFE*OUFSGBDF
// Send a push notification to iOS
val appleProfile = Profile.forApple(
URI("https://api.push.apple.com"),
certChain, privateKey, "bundleId")
val client = PushClient.of(appleProfile)
val push = Push.forApple(
title = "Push title",
body = "Push notification body")
val req = PushRequest(
provider = PushProvider.APPLE,
deviceToken = "your_device_token_here",
push = push)
val result: PushResult = client.send(req)
// Send a push notification to Android
val firebaseProfile = Profile.forFirebase(
URI("https://fcm.googleapis.com"),
googleCredentials)
val client = PushClient.of(firebaseProfile)
val push = Push.forFirebase(
title = "Push title",
body = "Push notification body")
val req = PushRequest(
provider = PushProvider.FIREBASE,
deviceToken = "your_device_token_here",
push = push)
val result: PushResult = client.send(req)
4JOHMFFOUSZQPJOUGPSBMMQVTIQMBUGPSNT