|
1 | 1 | # JPush Unity Plugin |
2 | 2 |
|
3 | 3 | [](https://gitter.im/jpush/jpush-unity3d-plugin) |
4 | | -[](https://github.com/jpush/jpush-unity3d-plugin/releases) |
| 4 | +[](https://github.com/jpush/jpush-unity3d-plugin/releases) |
5 | 5 | [](https://github.com/jpush/jpush-unity3d-plugin) |
6 | 6 | [](http://weibo.com/jpush?refer_flag=1001030101_&is_all=1) |
7 | 7 |
|
8 | 8 | 这是极光官方支持的 JPush Unity 插件(Android & iOS)。 |
9 | 9 |
|
10 | 10 | ## 集成 |
11 | | -运行插件目录下的 JPushUnityPlugin_vX.X.X.unitypackage。 |
| 11 | +运行插件目录下的 JPushUnityPlugin_vX.X.X.unitypackage |
12 | 12 |
|
13 | 13 | ### Android |
14 | 14 | - 替换 AndroidManifest.xml 里的包名。 |
|
59 | 59 |
|
60 | 60 | #if __IPHONE_OS_VERSION_MAX_ALLOWED > __IPHONE_7_1 |
61 | 61 | if ([[UIDevice currentDevice].systemVersion floatValue] >= 8.0) { |
62 | | - // 可以添加自定义 categories |
63 | | - [JPUSHService registerForRemoteNotificationTypes:(UIUserNotificationTypeBadge | UIUserNotificationTypeSound | UIUserNotificationTypeAlert) categories:nil]; |
| 62 | + // 可以添加自定义 categories |
| 63 | + [JPUSHService registerForRemoteNotificationTypes:(UIUserNotificationTypeBadge | UIUserNotificationTypeSound | UIUserNotificationTypeAlert) categories:nil]; |
64 | 64 | } else { |
65 | | - // categories 必须为 nil |
66 | | - [JPUSHService registerForRemoteNotificationTypes:(UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound | UIRemoteNotificationTypeAlert) categories:nil]; |
| 65 | + // categories 必须为 nil |
| 66 | + [JPUSHService registerForRemoteNotificationTypes:(UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound | UIRemoteNotificationTypeAlert) categories:nil]; |
67 | 67 | } |
68 | 68 | #else |
69 | | - // categories 必须为 nil |
70 | | - [JPUSHService registerForRemoteNotificationTypes:(UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound |UIRemoteNotificationTypeAlert) categories:nil]; |
| 69 | + // categories 必须为 nil |
| 70 | + [JPUSHService registerForRemoteNotificationTypes:(UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound |UIRemoteNotificationTypeAlert) categories:nil]; |
71 | 71 | #endif |
72 | 72 |
|
73 | 73 | /* |
|
90 | 90 | NSString *advertisingId = [[[ASIdentifierManager sharedManager] advertisingIdentifier] UUIDString]; |
91 | 91 | [JPUSHService setupWithOption:launchOptions appKey:@"abcacdf406411fa656ee11c3" channel:@"" apsForProduction:NO SadvertisingIdentifier:advertisingId]; |
92 | 92 |
|
93 | | - return YES; |
| 93 | + return YES; |
94 | 94 | } |
95 | 95 |
|
96 | 96 | - (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken { |
|
132 | 132 | ### Android |
133 | 133 | 在 Plugins\Android\src 目录下是一些 Java 文件,可以将其引入到 Android 工程中对其进行扩展,重新生成 Jar 包替换掉工程中 Assets\Plugins\Android 目录下的 JPush_Bridge.jar 文件。 |
134 | 134 |
|
135 | | -> [Android SDK API](/Doc/AndroidAPI.md)。 |
| 135 | +> [Android SDK API](/Doc/AndroidAPI.md) |
136 | 136 |
|
137 | 137 | ### iOS |
138 | 138 | iOS API 在文件 /Plugins/JPushBinding.cs 中,代码 #if UNITY_IPHONE 后面的即为可调用的 iOS API。 |
139 | 139 |
|
140 | | -> [iOS SDK API](http://docs.jpush.io/client/ios_api/)。 |
| 140 | +> [iOS SDK API](https://docs.jiguang.cn/jpush/client/iOS/ios_api/) |
141 | 141 |
|
142 | 142 | 亦可参照以下文档中与 `JPushBinding.cs` 中相同方法名的方法说明: |
143 | 143 |
|
144 | 144 | > [JPush Phonegap Plugin Common API doc](https://github.com/jpush/jpush-phonegap-plugin/blob/master/doc/Common_detail_api.md) |
145 | | -
|
146 | 145 | > [JPush Phonegap Plugin iOS API doc](https://github.com/jpush/jpush-phonegap-plugin/blob/master/doc/iOS_API.md) |
147 | 146 |
|
148 | 147 |
|
149 | | -
|
150 | 148 | ## 更多 |
151 | 149 | - [JPush 官网文档](http://docs.jiguang.cn/guideline/jmessage_guide/) |
152 | 150 | <!-- - 有问题可访问[极光社区](http://community.jpush.cn/)搜索和提问。 --> |
0 commit comments