Skip to content

Releases: jpush/jpush-unity3d-plugin

Release 3.1.3

22 Dec 09:13
Compare
Choose a tag to compare

改动

  • iOS 新增接收本地推送事件。
  • 修复应用没启动点击通知无法正常回调问题。

配置更新改动

  • UnityAppController.mm 中的导入头文件 #import "JPushEventCache.h"

  • UnityAppController.mm 中的 didFinishLaunchingWithOptions 中如下代码:

    if ([[UIDevice currentDevice].systemVersion floatValue] >= 10.0) {
          #ifdef NSFoundationVersionNumber_iOS_9_x_Max
          JPUSHRegisterEntity * entity = [[JPUSHRegisterEntity alloc] init];
          entity.types = UNAuthorizationOptionAlert | UNAuthorizationOptionBadge | UNAuthorizationOptionSound;
          [JPUSHService registerForRemoteNotificationConfig:entity delegate:self];
          #endif
      }
    
      #if __IPHONE_OS_VERSION_MAX_ALLOWED > __IPHONE_7_1
      if ([[UIDevice currentDevice].systemVersion floatValue] >= 8.0) {
        // 可以添加自定义 categories
        [JPUSHService registerForRemoteNotificationTypes:(UIUserNotificationTypeBadge | UIUserNotificationTypeSound | UIUserNotificationTypeAlert) categories:nil];
      } else {
        // categories 必须为 nil
        [JPUSHService registerForRemoteNotificationTypes:(UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound |  UIRemoteNotificationTypeAlert) categories:nil];
      }
      #else
      // categories 必须为 nil
      [JPUSHService registerForRemoteNotificationTypes:(UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound |UIRemoteNotificationTypeAlert) categories:nil];
      #endif

替换成:

  [[JPushEventCache sharedInstance] handFinishLaunchOption:launchOptions];
  • UnityAppController.mm 中的下列代码:

    - (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo {
      // Required.
      [[NSNotificationCenter defaultCenter] postNotificationName:@"JPushPluginReceiveNotification" object:userInfo];
      [JPUSHService handleRemoteNotification:userInfo];
    }
    
    - (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult result))handler
    {
      [[NSNotificationCenter defaultCenter] postNotificationName:@"JPushPluginReceiveNotification" object:userInfo];
    }

    替换成:

    - (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo {
      // Required.
      [[JPushEventCache sharedInstance] sendEvent:userInfo withKey:@"JPushPluginReceiveNotification"];
      [JPUSHService handleRemoteNotification:userInfo];
    }
    
    - (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult result))handler
    {
      [[JPushEventCache sharedInstance] sendEvent:userInfo withKey:@"JPushPluginReceiveNotification"];
    }
    
    - (void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification {
      NSDictionary* localNotificationEvent = @{@"content":notification.alertBody,
                                               @"badge": @(notification.applicationIconBadgeNumber),
                                               @"extras":notification.userInfo,
                                               };
      
        [[JPushEventCache sharedInstance] sendEvent: localNotificationEvent withKey:@"JPushPluginReceiveNotification"];
    }

v3.1.1

15 Dec 06:10
Compare
Choose a tag to compare

Improvements

  • Update Android SDK to v3.1.0.

v3.1.0

19 Oct 06:13
Compare
Choose a tag to compare

本次更新修改了 C# 层的方法命名,Android 与 iOS 合并了一些方法,升级时请注意,具体可参考 Common API

Improvements

  • 更新 iOS SDK 至 v3.0.7
  • 优化 C# 层方法,规范方法命名;
  • 更新 Tag / Alias 相关方法(具体可查看 API 文档);
  • 提供更详细的 API 文档及注释;

v3.0.7

07 Sep 09:11
Compare
Choose a tag to compare

Improvements

  • Update Android SDK to v3.0.8.

Bug Fixes

  • isPushStopped not found in Android.

v3.0.6

08 Jun 05:50
Compare
Choose a tag to compare

Android

iOS

v3.0.3

30 Mar 08:51
Compare
Choose a tag to compare

Android

  • 更新 Android SDK 至 v3.0.3
  • 新增 API
    • addLocalNotificationByDate:根据日期设置本地通知。

v3.0.0

13 Mar 06:41
Compare
Choose a tag to compare

iOS

更新 SDK v3.0.2

Android

更新 SDK v3.0.1

v2.1.4

28 Nov 03:18
Compare
Choose a tag to compare

iOS

  • 更新 JPush iOS SDK 2.2.0
  • 支持 iOS 10 推送(需按照最新 README.md 添加相应类库及代码)
  • 添加 API - networkDidReceivePushNotificationCallBack

v2.1.3

22 Jun 09:24
Compare
Choose a tag to compare

优化插件安装方式。

Android

更新 JPush Android SDK 至 2.1.6 版本

v2.1.2

12 Jun 05:26
Compare
Choose a tag to compare

iOS

  • 更新 iOS demo
  • 更新 README.md
  • 修复原有 API 的错误
  • 添加新的 API
    • 设置 badge
    • 页面统计
    • 开关日志
    • 本地推送
    • 地理位置上报