Push Notification
Push Notification Setup
import Kommunicatea) Send device token to Kommunicate server:
func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data)
{
print("DEVICE_TOKEN_DATA :: \(deviceToken.description)")
var deviceTokenString: String = ""
for i in 0..count
{
deviceTokenString += String(format: "%02.2hhx", deviceToken[i] as CVarArg)
}
print("DEVICE_TOKEN_STRING :: \(deviceTokenString)")
if (KMUserDefaultHandler.getApnDeviceToken() != deviceTokenString)
{
let kmRegisterUserClientService: KMRegisterUserClientService = KMRegisterUserClientService()
kmRegisterUserClientService.updateApnDeviceToken(withCompletion: deviceTokenString, withCompletion: { (response, error) in
print ("REGISTRATION_RESPONSE :: \(String(describing: response))")
})
}
}
b) Receiving push notification:
c) Handling app launch on notification click:
d) AppDelegate changes for foreground notification:
e) Save Context when app terminates:
Certificates
a) Upload development and distribution APNs certificates
b) Updating Capabilities
Last updated
Was this helpful?