juggleim-rnsdk 1.0.3 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -650,7 +650,7 @@ code + .copy-button {
650
650
  <script type="text/javascript">
651
651
  function configurationCacheProblems() { return (
652
652
  // begin-report-data
653
- {"diagnostics":[{"locations":[{},{"pluginId":"com.android.internal.library"}],"problem":[{"text":"The Provider.forUseAtConfigurationTime method has been deprecated."}],"severity":"WARNING","problemDetails":[{"text":"This is scheduled to be removed in Gradle 9.0."}],"contextualLabel":"The Provider.forUseAtConfigurationTime method has been deprecated.","documentationLink":"https://docs.gradle.org/9.0-milestone-1/userguide/upgrading_version_7.html#for_use_at_configuration_time_deprecation","problemId":[{"name":"deprecation","displayName":"Deprecation"},{"name":"the-provider-foruseatconfigurationtime-method-has-been-deprecated","displayName":"The Provider.forUseAtConfigurationTime method has been deprecated."}],"solutions":[[{"text":"Simply remove the call."}]]},{"locations":[{},{"pluginId":"com.android.internal.library"}],"problem":[{"text":"The Provider.forUseAtConfigurationTime method has been deprecated."}],"severity":"WARNING","problemDetails":[{"text":"This is scheduled to be removed in Gradle 9.0."}],"contextualLabel":"The Provider.forUseAtConfigurationTime method has been deprecated.","documentationLink":"https://docs.gradle.org/9.0-milestone-1/userguide/upgrading_version_7.html#for_use_at_configuration_time_deprecation","problemId":[{"name":"deprecation","displayName":"Deprecation"},{"name":"the-provider-foruseatconfigurationtime-method-has-been-deprecated","displayName":"The Provider.forUseAtConfigurationTime method has been deprecated."}],"solutions":[[{"text":"Simply remove the call."}]]},{"locations":[{},{"pluginId":"com.android.internal.library"}],"problem":[{"text":"The Provider.forUseAtConfigurationTime method has been deprecated."}],"severity":"WARNING","problemDetails":[{"text":"This is scheduled to be removed in Gradle 9.0."}],"contextualLabel":"The Provider.forUseAtConfigurationTime method has been deprecated.","documentationLink":"https://docs.gradle.org/9.0-milestone-1/userguide/upgrading_version_7.html#for_use_at_configuration_time_deprecation","problemId":[{"name":"deprecation","displayName":"Deprecation"},{"name":"the-provider-foruseatconfigurationtime-method-has-been-deprecated","displayName":"The Provider.forUseAtConfigurationTime method has been deprecated."}],"solutions":[[{"text":"Simply remove the call."}]]},{"locations":[{},{"pluginId":"com.android.internal.library"}],"problem":[{"text":"The Provider.forUseAtConfigurationTime method has been deprecated."}],"severity":"WARNING","problemDetails":[{"text":"This is scheduled to be removed in Gradle 9.0."}],"contextualLabel":"The Provider.forUseAtConfigurationTime method has been deprecated.","documentationLink":"https://docs.gradle.org/9.0-milestone-1/userguide/upgrading_version_7.html#for_use_at_configuration_time_deprecation","problemId":[{"name":"deprecation","displayName":"Deprecation"},{"name":"the-provider-foruseatconfigurationtime-method-has-been-deprecated","displayName":"The Provider.forUseAtConfigurationTime method has been deprecated."}],"solutions":[[{"text":"Simply remove the call."}]]},{"locations":[{},{"pluginId":"com.android.internal.library"}],"problem":[{"text":"The Provider.forUseAtConfigurationTime method has been deprecated."}],"severity":"WARNING","problemDetails":[{"text":"This is scheduled to be removed in Gradle 9.0."}],"contextualLabel":"The Provider.forUseAtConfigurationTime method has been deprecated.","documentationLink":"https://docs.gradle.org/9.0-milestone-1/userguide/upgrading_version_7.html#for_use_at_configuration_time_deprecation","problemId":[{"name":"deprecation","displayName":"Deprecation"},{"name":"the-provider-foruseatconfigurationtime-method-has-been-deprecated","displayName":"The Provider.forUseAtConfigurationTime method has been deprecated."}],"solutions":[[{"text":"Simply remove the call."}]]},{"locations":[{},{"pluginId":"com.android.internal.library"}],"problem":[{"text":"The Provider.forUseAtConfigurationTime method has been deprecated."}],"severity":"WARNING","problemDetails":[{"text":"This is scheduled to be removed in Gradle 9.0."}],"contextualLabel":"The Provider.forUseAtConfigurationTime method has been deprecated.","documentationLink":"https://docs.gradle.org/9.0-milestone-1/userguide/upgrading_version_7.html#for_use_at_configuration_time_deprecation","problemId":[{"name":"deprecation","displayName":"Deprecation"},{"name":"the-provider-foruseatconfigurationtime-method-has-been-deprecated","displayName":"The Provider.forUseAtConfigurationTime method has been deprecated."}],"solutions":[[{"text":"Simply remove the call."}]]},{"locations":[{},{"pluginId":"com.android.internal.library"}],"problem":[{"text":"The Provider.forUseAtConfigurationTime method has been deprecated."}],"severity":"WARNING","problemDetails":[{"text":"This is scheduled to be removed in Gradle 9.0."}],"contextualLabel":"The Provider.forUseAtConfigurationTime method has been deprecated.","documentationLink":"https://docs.gradle.org/9.0-milestone-1/userguide/upgrading_version_7.html#for_use_at_configuration_time_deprecation","problemId":[{"name":"deprecation","displayName":"Deprecation"},{"name":"the-provider-foruseatconfigurationtime-method-has-been-deprecated","displayName":"The Provider.forUseAtConfigurationTime method has been deprecated."}],"solutions":[[{"text":"Simply remove the call."}]]},{"locations":[{},{"pluginId":"com.android.internal.library"}],"problem":[{"text":"The Provider.forUseAtConfigurationTime method has been deprecated."}],"severity":"WARNING","problemDetails":[{"text":"This is scheduled to be removed in Gradle 9.0."}],"contextualLabel":"The Provider.forUseAtConfigurationTime method has been deprecated.","documentationLink":"https://docs.gradle.org/9.0-milestone-1/userguide/upgrading_version_7.html#for_use_at_configuration_time_deprecation","problemId":[{"name":"deprecation","displayName":"Deprecation"},{"name":"the-provider-foruseatconfigurationtime-method-has-been-deprecated","displayName":"The Provider.forUseAtConfigurationTime method has been deprecated."}],"solutions":[[{"text":"Simply remove the call."}]]}],"problemsReport":{"totalProblemCount":8,"buildName":"android","requestedTasks":":compileDebugJavaWithJavac","documentationLink":"https://docs.gradle.org/9.0-milestone-1/userguide/reporting_problems.html","documentationLinkCaption":"Problem report","summaries":[]}}
653
+ {"diagnostics":[{"locations":[{}],"problem":[{"text":"Specifying custom build file location has been deprecated."}],"severity":"WARNING","problemDetails":[{"text":"This is scheduled to be removed in Gradle 9.0."}],"contextualLabel":"Specifying custom build file location has been deprecated.","documentationLink":"https://docs.gradle.org/9.0-milestone-1/userguide/upgrading_version_7.html#configuring_custom_build_layout","problemId":[{"name":"deprecation","displayName":"Deprecation"},{"name":"specifying-custom-build-file-location","displayName":"Specifying custom build file location has been deprecated."}]},{"locations":[{},{"pluginId":"com.android.internal.library"}],"problem":[{"text":"The Provider.forUseAtConfigurationTime method has been deprecated."}],"severity":"WARNING","problemDetails":[{"text":"This is scheduled to be removed in Gradle 9.0."}],"contextualLabel":"The Provider.forUseAtConfigurationTime method has been deprecated.","documentationLink":"https://docs.gradle.org/9.0-milestone-1/userguide/upgrading_version_7.html#for_use_at_configuration_time_deprecation","problemId":[{"name":"deprecation","displayName":"Deprecation"},{"name":"the-provider-foruseatconfigurationtime-method-has-been-deprecated","displayName":"The Provider.forUseAtConfigurationTime method has been deprecated."}],"solutions":[[{"text":"Simply remove the call."}]]},{"locations":[{},{"pluginId":"com.android.internal.library"}],"problem":[{"text":"The Provider.forUseAtConfigurationTime method has been deprecated."}],"severity":"WARNING","problemDetails":[{"text":"This is scheduled to be removed in Gradle 9.0."}],"contextualLabel":"The Provider.forUseAtConfigurationTime method has been deprecated.","documentationLink":"https://docs.gradle.org/9.0-milestone-1/userguide/upgrading_version_7.html#for_use_at_configuration_time_deprecation","problemId":[{"name":"deprecation","displayName":"Deprecation"},{"name":"the-provider-foruseatconfigurationtime-method-has-been-deprecated","displayName":"The Provider.forUseAtConfigurationTime method has been deprecated."}],"solutions":[[{"text":"Simply remove the call."}]]},{"locations":[{},{"pluginId":"com.android.internal.library"}],"problem":[{"text":"The Provider.forUseAtConfigurationTime method has been deprecated."}],"severity":"WARNING","problemDetails":[{"text":"This is scheduled to be removed in Gradle 9.0."}],"contextualLabel":"The Provider.forUseAtConfigurationTime method has been deprecated.","documentationLink":"https://docs.gradle.org/9.0-milestone-1/userguide/upgrading_version_7.html#for_use_at_configuration_time_deprecation","problemId":[{"name":"deprecation","displayName":"Deprecation"},{"name":"the-provider-foruseatconfigurationtime-method-has-been-deprecated","displayName":"The Provider.forUseAtConfigurationTime method has been deprecated."}],"solutions":[[{"text":"Simply remove the call."}]]},{"locations":[{},{"pluginId":"com.android.internal.library"}],"problem":[{"text":"The Provider.forUseAtConfigurationTime method has been deprecated."}],"severity":"WARNING","problemDetails":[{"text":"This is scheduled to be removed in Gradle 9.0."}],"contextualLabel":"The Provider.forUseAtConfigurationTime method has been deprecated.","documentationLink":"https://docs.gradle.org/9.0-milestone-1/userguide/upgrading_version_7.html#for_use_at_configuration_time_deprecation","problemId":[{"name":"deprecation","displayName":"Deprecation"},{"name":"the-provider-foruseatconfigurationtime-method-has-been-deprecated","displayName":"The Provider.forUseAtConfigurationTime method has been deprecated."}],"solutions":[[{"text":"Simply remove the call."}]]},{"locations":[{},{"pluginId":"com.android.internal.library"}],"problem":[{"text":"The Provider.forUseAtConfigurationTime method has been deprecated."}],"severity":"WARNING","problemDetails":[{"text":"This is scheduled to be removed in Gradle 9.0."}],"contextualLabel":"The Provider.forUseAtConfigurationTime method has been deprecated.","documentationLink":"https://docs.gradle.org/9.0-milestone-1/userguide/upgrading_version_7.html#for_use_at_configuration_time_deprecation","problemId":[{"name":"deprecation","displayName":"Deprecation"},{"name":"the-provider-foruseatconfigurationtime-method-has-been-deprecated","displayName":"The Provider.forUseAtConfigurationTime method has been deprecated."}],"solutions":[[{"text":"Simply remove the call."}]]},{"locations":[{},{"pluginId":"com.android.internal.library"}],"problem":[{"text":"The Provider.forUseAtConfigurationTime method has been deprecated."}],"severity":"WARNING","problemDetails":[{"text":"This is scheduled to be removed in Gradle 9.0."}],"contextualLabel":"The Provider.forUseAtConfigurationTime method has been deprecated.","documentationLink":"https://docs.gradle.org/9.0-milestone-1/userguide/upgrading_version_7.html#for_use_at_configuration_time_deprecation","problemId":[{"name":"deprecation","displayName":"Deprecation"},{"name":"the-provider-foruseatconfigurationtime-method-has-been-deprecated","displayName":"The Provider.forUseAtConfigurationTime method has been deprecated."}],"solutions":[[{"text":"Simply remove the call."}]]},{"locations":[{},{"pluginId":"com.android.internal.library"}],"problem":[{"text":"The Provider.forUseAtConfigurationTime method has been deprecated."}],"severity":"WARNING","problemDetails":[{"text":"This is scheduled to be removed in Gradle 9.0."}],"contextualLabel":"The Provider.forUseAtConfigurationTime method has been deprecated.","documentationLink":"https://docs.gradle.org/9.0-milestone-1/userguide/upgrading_version_7.html#for_use_at_configuration_time_deprecation","problemId":[{"name":"deprecation","displayName":"Deprecation"},{"name":"the-provider-foruseatconfigurationtime-method-has-been-deprecated","displayName":"The Provider.forUseAtConfigurationTime method has been deprecated."}],"solutions":[[{"text":"Simply remove the call."}]]},{"locations":[{},{"pluginId":"com.android.internal.library"}],"problem":[{"text":"The Provider.forUseAtConfigurationTime method has been deprecated."}],"severity":"WARNING","problemDetails":[{"text":"This is scheduled to be removed in Gradle 9.0."}],"contextualLabel":"The Provider.forUseAtConfigurationTime method has been deprecated.","documentationLink":"https://docs.gradle.org/9.0-milestone-1/userguide/upgrading_version_7.html#for_use_at_configuration_time_deprecation","problemId":[{"name":"deprecation","displayName":"Deprecation"},{"name":"the-provider-foruseatconfigurationtime-method-has-been-deprecated","displayName":"The Provider.forUseAtConfigurationTime method has been deprecated."}],"solutions":[[{"text":"Simply remove the call."}]]}],"problemsReport":{"totalProblemCount":9,"buildName":"android","requestedTasks":"assembleDebug","documentationLink":"https://docs.gradle.org/9.0-milestone-1/userguide/reporting_problems.html","documentationLinkCaption":"Problem report","summaries":[]}}
654
654
  // end-report-data
655
655
  );}
656
656
  </script>
@@ -147,6 +147,23 @@ public class JuggleIMManager extends ReactContextBaseJavaModule {
147
147
  JIM.getInstance().init(getCurrentActivity(), appKey, builder.build());
148
148
  }
149
149
 
150
+ /**
151
+ * 清除应用角标数字
152
+ *
153
+ * @param promise 清理结果回调,成功返回 true
154
+ */
155
+ @ReactMethod
156
+ public void clearBadgeNumber(Promise promise) {
157
+ try {
158
+ // 简要描述:极光推送维护厂商角标数字,打开 App 后将角标归零。
159
+ JPushInterface.setBadgeNumber(getReactApplicationContext(), 0);
160
+ promise.resolve(true);
161
+ } catch (Exception e) {
162
+ Log.e("JuggleIM", "清除应用角标数字失败", e);
163
+ promise.reject("clear_badge_error", "清除应用角标数字失败: " + e.getMessage(), e);
164
+ }
165
+ }
166
+
150
167
  /**
151
168
  * 注册自定义消息类型
152
169
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "juggleim-rnsdk",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "description": "React Native wrapper for Juggle IM SDK",
5
5
  "main": "src/index.js",
6
6
  "types": "src/index.d.ts",
package/src/index.d.ts CHANGED
@@ -60,6 +60,13 @@ export default class JuggleIM {
60
60
  * @param enableJGPush 是否开启极光推送
61
61
  */
62
62
  static initWithPush(appKey: string, enableJGPush: boolean): void;
63
+
64
+ /**
65
+ * 清除 Android 应用角标数字
66
+ * @returns 清理结果
67
+ */
68
+ static clearBadgeNumber(): Promise<Boolean>;
69
+
63
70
  /**
64
71
  * 注册自定义消息类型
65
72
  * @param contentType 消息类型标识符(不能以 "jg:" 开头)
package/src/index.js CHANGED
@@ -66,6 +66,17 @@ class JuggleIM {
66
66
  }
67
67
  }
68
68
 
69
+ /**
70
+ * 清除 Android 应用角标数字
71
+ * @returns {Promise<boolean>} 清理结果
72
+ */
73
+ static clearBadgeNumber() {
74
+ if (Platform.OS === "android") {
75
+ return JMI.clearBadgeNumber();
76
+ }
77
+ return Promise.resolve(true);
78
+ }
79
+
69
80
  /**
70
81
  * 连接到服务器
71
82
  * @param {string} token - 用户token
File without changes