我在使用胶子制作的Android应用程序上遇到问题;当我发送推送通知并且应用程序关闭时,状态栏通知不会显示;这个问题发生在我身上只有一些设备,尤其是华为Android 6.0版本。我已经分析了日志,当我收到设备上的通知时退出:
SendBroadcastPermission:action:com.google.android.c2dm.intent.RECEIVE,mPermissionType:0 SendBroadcastPermission:action:com.google.android.c2dm.intent.RECEIVE,mPermissionType:0 GCM-DMM:广播意图回调:result = CANCELED forIntent {act = com.google.android.c2dm.intent.RECEIVE pkg = MY_PACkAGE_NAME_APP(有额外内容)}
<?xml version="1.0" encoding="UTF-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="PACKAGE_NAME"
android:versionCode="144"
android:versionName="2.0" >
<supports-screens
android:anyDensity="true"
android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:xlargeScreens="true" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="PACKAGE_NAME.permission.C2D_MESSAGE" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission
android:name="android.permission.CALL_PHONE"
android:required="false" />
<permission
android:name="PACKAGE_NAME.permission.C2D_MESSAGE"
android:protectionLevel="signature" />
<uses-permission android:name="PACKAGE_NAME.permission.C2D_MESSAGE" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<uses-sdk
android:minSdkVersion="14"
android:targetSdkVersion="21" />
<application
android:name="android.support.multidex.MultiDexApplication"
android:icon="@mipmap/ws_icon"
android:label="Ws Tech" >
<meta-data
android:name="com.google.android.gms.version"
android:value="9452000" />
<activity
android:name="javafxports.android.FXActivity"
android:configChanges="orientation|screenSize"
android:label="Ws Tech"
android:screenOrientation="portrait" >
<meta-data
android:name="main.class"
android:value="PACKAGE_NAME.WSMainApplication" />
<meta-data
android:name="debug.port"
android:value="0" />
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<service
android:name="com.gluonhq.impl.charm.down.plugins.android.PushNotificationJobService"
android:exported="true"
android:permission="android.permission.BIND_JOB_SERVICE" />
<service
android:name="com.gluonhq.impl.charm.down.plugins.android.PushGcmListenerService"
android:exported="false" >
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<category android:name="PACKAGE_NAME" />
</intent-filter>
</service>
<receiver android:name="com.gluonhq.impl.charm.down.plugins.android.AlarmReceiver" />
<receiver
android:name="com.google.android.gms.gcm.GcmReceiver"
android:exported="true"
android:permission="com.google.android.c2dm.permission.SEND" >
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<category android:name="PACKAGE_NAME" />
</intent-filter>
</receiver>
<service
android:name="com.gluonhq.impl.charm.down.plugins.android.PushInstanceIDListenerService"
android:exported="false" >
<intent-filter>
<action android:name="com.google.android.gms.iid.InstanceID" />
</intent-filter>
</service>
<service
android:name="com.gluonhq.impl.charm.down.plugins.android.RegistrationIntentService"
android:exported="false" >
</service>
<activity
android:name="com.gluonhq.impl.charm.down.plugins.android.PushNotificationActivity"
android:parentActivityName="javafxports.android.FXActivity" >
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="javafxports.android.FXActivity" />
</activity>
<activity android:name="com.gluonhq.impl.charm.down.plugins.android.PermissionRequestActivity" />
<activity
android:name="com.gluonhq.impl.charm.down.plugins.android.NotificationActivity"
android:parentActivityName="javafxports.android.FXActivity"
android:screenOrientation="portrait" >
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="javafxports.android.FXActivity" />
</activity>
</application>
</manifest>