更新JPush540

This commit is contained in:
lcTerry 2024-07-11 10:38:51 +08:00
parent c4ec7f3c2a
commit 7fafe5aea3
6 changed files with 25 additions and 23 deletions

View File

@ -117,7 +117,7 @@
<activity <activity
android:name="cn.jpush.android.ui.PopWinActivity" android:name="cn.jpush.android.ui.PopWinActivity"
android:exported="true" android:exported="true"
android:theme="@style/MyDialogStyle" > android:theme="@style/JPushDialogStyle" >
<intent-filter> <intent-filter>
<category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.DEFAULT" />
@ -169,13 +169,13 @@
<receiver android:name="cn.jpush.android.service.SchedulerReceiver" android:exported="false"/> <receiver android:name="cn.jpush.android.service.SchedulerReceiver" android:exported="false"/>
<!--since 3.3.0 接收JPush相关事件--> <!--since 3.3.0 接收JPush相关事件-->
<service android:name="cn.jiguang.cordova.push.JPushEventReceiver" <receiver android:name="cn.jiguang.cordova.push.JPushEventReceiver"
android:exported="false"> android:exported="false">
<intent-filter> <intent-filter>
<action android:name="cn.jpush.android.intent.RECEIVE_MESSAGE" /> <action android:name="cn.jpush.android.intent.RECEIVER_MESSAGE" />
<category android:name="$PACKAGE_NAME"></category> <category android:name="$PACKAGE_NAME"></category>
</intent-filter> </intent-filter>
</service> </receiver>
<!--since 3.3.0 Required SDK核心功能--> <!--since 3.3.0 Required SDK核心功能-->
@ -236,9 +236,11 @@
<meta-data android:name="JPUSH_CHANNEL" android:value="$CHANNEL"/> <meta-data android:name="JPUSH_CHANNEL" android:value="$CHANNEL"/>
<meta-data android:name="JPUSH_APPKEY" android:value="$APP_KEY" /> <!-- </>值来自开发者平台取得的AppKey--> <meta-data android:name="JPUSH_APPKEY" android:value="$APP_KEY" /> <!-- </>值来自开发者平台取得的AppKey-->
<provider <provider
android:exported="false" android:name="cn.jpush.android.service.InitProvider"
android:authorities="${applicationId}.jiguang.InitProvider" android:authorities="${applicationId}.jiguang.InitProvider"
android:name="cn.jpush.android.service.InitProvider"></provider> android:exported="false"
android:readPermission="${applicationId}.permission.JPUSH_MESSAGE"
android:writePermission="${applicationId}.permission.JPUSH_MESSAGE" />
</config-file> </config-file>
<lib-file src="src/android/libs/jpush-android-5.2.0.jar" /> <lib-file src="src/android/libs/jpush-android-5.2.0.jar" />

View File

@ -15,16 +15,16 @@ import cn.jpush.android.api.CustomMessage;
import cn.jpush.android.api.JPushMessage; import cn.jpush.android.api.JPushMessage;
import cn.jpush.android.api.NotificationMessage; import cn.jpush.android.api.NotificationMessage;
import cn.jpush.android.helper.Logger; import cn.jpush.android.helper.Logger;
import cn.jpush.android.service.JPushMessageService; import cn.jpush.android.service.JPushMessageReceiver;
public class JPushEventReceiver extends JPushMessageService { public class JPushEventReceiver extends JPushMessageReceiver {
private static final String TAG = JPushEventReceiver.class.getSimpleName(); private static final String TAG = JPushEventReceiver.class.getSimpleName();
@Override @Override
public void onTagOperatorResult(Context context, JPushMessage jPushMessage) { public void onTagOperatorResult(Context context, JPushMessage jPushMessage) {
super.onTagOperatorResult(context, jPushMessage); super.onTagOperatorResult(context, jPushMessage);
JLogger.d(TAG,"onTagOperatorResult:"+jPushMessage); cn.jiguang.cordova.push.JLogger.d(TAG,"onTagOperatorResult:"+jPushMessage);
tryCallback(jPushMessage, new SuccessCallback() { tryCallback(jPushMessage, new SuccessCallback() {
@Override @Override
@ -46,7 +46,7 @@ public class JPushEventReceiver extends JPushMessageService {
public void onCheckTagOperatorResult(Context context, JPushMessage jPushMessage) { public void onCheckTagOperatorResult(Context context, JPushMessage jPushMessage) {
super.onCheckTagOperatorResult(context, jPushMessage); super.onCheckTagOperatorResult(context, jPushMessage);
JLogger.d(TAG,"onCheckTagOperatorResult:"+jPushMessage); cn.jiguang.cordova.push.JLogger.d(TAG,"onCheckTagOperatorResult:"+jPushMessage);
tryCallback(jPushMessage, new SuccessCallback() { tryCallback(jPushMessage, new SuccessCallback() {
@Override @Override
@ -61,7 +61,7 @@ public class JPushEventReceiver extends JPushMessageService {
public void onAliasOperatorResult(Context context, JPushMessage jPushMessage) { public void onAliasOperatorResult(Context context, JPushMessage jPushMessage) {
super.onAliasOperatorResult(context, jPushMessage); super.onAliasOperatorResult(context, jPushMessage);
JLogger.d(TAG,"onAliasOperatorResult:"+jPushMessage); cn.jiguang.cordova.push.JLogger.d(TAG,"onAliasOperatorResult:"+jPushMessage);
tryCallback(jPushMessage, new SuccessCallback() { tryCallback(jPushMessage, new SuccessCallback() {
@Override @Override
@ -75,8 +75,8 @@ public class JPushEventReceiver extends JPushMessageService {
@Override @Override
public void onRegister(Context context, String regId) { public void onRegister(Context context, String regId) {
JLogger.d(TAG,"onRegister:"+regId); cn.jiguang.cordova.push.JLogger.d(TAG,"onRegister:"+regId);
JPushPlugin.transmitReceiveRegistrationId(regId); cn.jiguang.cordova.push.JPushPlugin.transmitReceiveRegistrationId(regId);
} }
@Override @Override
@ -92,19 +92,19 @@ public class JPushEventReceiver extends JPushMessageService {
public void onNotifyMessageArrived(Context context, NotificationMessage notificationMessage) { public void onNotifyMessageArrived(Context context, NotificationMessage notificationMessage) {
super.onNotifyMessageArrived(context, notificationMessage); super.onNotifyMessageArrived(context, notificationMessage);
JLogger.d(TAG,"onNotifyMessageArrived:"+notificationMessage); cn.jiguang.cordova.push.JLogger.d(TAG,"onNotifyMessageArrived:"+notificationMessage);
} }
@Override @Override
public void onNotifyMessageOpened(Context context, NotificationMessage notificationMessage) { public void onNotifyMessageOpened(Context context, NotificationMessage notificationMessage) {
super.onNotifyMessageOpened(context, notificationMessage); super.onNotifyMessageOpened(context, notificationMessage);
JLogger.d(TAG,"onNotifyMessageOpened:"+notificationMessage); cn.jiguang.cordova.push.JLogger.d(TAG,"onNotifyMessageOpened:"+notificationMessage);
} }
@Override @Override
public void onMobileNumberOperatorResult(Context context, JPushMessage jPushMessage) { public void onMobileNumberOperatorResult(Context context, JPushMessage jPushMessage) {
super.onMobileNumberOperatorResult(context, jPushMessage); super.onMobileNumberOperatorResult(context, jPushMessage);
JLogger.d(TAG,"onMobileNumberOperatorResult:"+jPushMessage); cn.jiguang.cordova.push.JLogger.d(TAG,"onMobileNumberOperatorResult:"+jPushMessage);
tryCallback(jPushMessage, new SuccessCallback() { tryCallback(jPushMessage, new SuccessCallback() {
@Override @Override
@ -119,11 +119,11 @@ public class JPushEventReceiver extends JPushMessageService {
@Override @Override
public void onMultiActionClicked(Context context, Intent intent) { public void onMultiActionClicked(Context context, Intent intent) {
super.onMultiActionClicked(context, intent); super.onMultiActionClicked(context, intent);
JLogger.d(TAG,"onMultiActionClicked:"+intent); cn.jiguang.cordova.push.JLogger.d(TAG,"onMultiActionClicked:"+intent);
} }
@Override @Override
public void onInAppMessageShow(Context context,final NotificationMessage message) { public void onInAppMessageShow(Context context,final NotificationMessage message) {
JLogger.d(TAG, "[onInAppMessageShow], " + message.toString()); cn.jiguang.cordova.push.JLogger.d(TAG, "[onInAppMessageShow], " + message.toString());
try { try {
JSONObject jsonObject=new JSONObject(); JSONObject jsonObject=new JSONObject();
jsonObject.put("title", message.inAppMsgTitle); jsonObject.put("title", message.inAppMsgTitle);
@ -141,7 +141,7 @@ public class JPushEventReceiver extends JPushMessageService {
@Override @Override
public void onInAppMessageClick(Context context,final NotificationMessage message) { public void onInAppMessageClick(Context context,final NotificationMessage message) {
JLogger.d(TAG, "[onInAppMessageClick], " + message.toString()); cn.jiguang.cordova.push.JLogger.d(TAG, "[onInAppMessageClick], " + message.toString());
try { try {
JSONObject jsonObject=new JSONObject(); JSONObject jsonObject=new JSONObject();
jsonObject.put("title", message.inAppMsgTitle); jsonObject.put("title", message.inAppMsgTitle);
@ -170,7 +170,7 @@ public class JPushEventReceiver extends JPushMessageService {
e.printStackTrace(); e.printStackTrace();
} }
CallbackContext callback = JPushPlugin.eventCallbackMap.get(sequence); CallbackContext callback = cn.jiguang.cordova.push.JPushPlugin.eventCallbackMap.get(sequence);
if (callback == null) { if (callback == null) {
Logger.i(TAG, "Unexpected error, callback is null!"); Logger.i(TAG, "Unexpected error, callback is null!");
@ -194,7 +194,7 @@ public class JPushEventReceiver extends JPushMessageService {
callback.error(resultJson); callback.error(resultJson);
} }
JPushPlugin.eventCallbackMap.remove(sequence); cn.jiguang.cordova.push.JPushPlugin.eventCallbackMap.remove(sequence);
} }
} }

Binary file not shown.

View File

@ -2,7 +2,7 @@
<LinearLayout <LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/popLayoutId" android:id="@+id/popLayoutId"
style="@style/MyDialogStyle" style="@style/JPushDialogStyle"
android:orientation="vertical" android:orientation="vertical"
android:layout_width="280dp" android:layout_width="280dp"
android:layout_height="380dp" > android:layout_height="380dp" >

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android"> <resources xmlns:android="http://schemas.android.com/apk/res/android">
<style name="MyDialogStyle"> <style name="JPushDialogStyle">
<item name="android:windowBackground">@android:color/transparent</item> <item name="android:windowBackground">@android:color/transparent</item>
<item name="android:windowFrame">@null</item> <item name="android:windowFrame">@null</item>
<item name="android:windowNoTitle">true</item> <item name="android:windowNoTitle">true</item>