获取APNs deviceToken.
EasemobApns.requestAuthorization(
options: {
AuthorizationOptions.alert,
AuthorizationOptions.badge,
AuthorizationOptions.sound
},
);
EasemobApns.registerDeviceToken();
EasemobApns.unregisterDeviceToken();
EasemobApns.setHandler(
onToken: (deviceToken, error) {
debugPrint("deviceToken: $deviceToken, error: $error");
},
onLaunch: (map) {
debugPrint("onLaunch: ${map?.keys.first}");
},
onMessage: (map) {
debugPrint("onMessage: ${map.keys.first}");
},
);