Skip to content

dujiepeng/easemob_apns

Repository files navigation

easemob_apns

获取APNs deviceToken.

Getting Started

设置权限

    EasemobApns.requestAuthorization(
      options: {
        AuthorizationOptions.alert,
        AuthorizationOptions.badge,
        AuthorizationOptions.sound
      },
    );

申请DeviceToken

    EasemobApns.registerDeviceToken();

注销DeviceToken

    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}");
      },
    );

About

flutter apns plugin

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published