我根据https://docs.apptentive.com/android/integration/
中的GCM说明将我的Android应用程序与apptentive集成当我回复来自apptentive web UI的消息时,我正在观察应用程序端的两个通知行为。
当应用程序打开时,我自己的GCM监听器被调用。 当应用程序未处于打开状态时,我自己的GCM侦听器未被调用,但是我看到一个带有应用程序默认图标的通知,“您有一条新消息”“”。
我不确定是谁在创建这个新的/不需要的通知。 这会导致问题,因为单击此新通知会将用户带到我的活动,但不会打开消息中心。
规格: Sdk版本是2.1.3 运行Android 5.1.1的设备
<?xml version="1.0" encoding="utf-8"?>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<!-- Used by apptentive to get email address automatically. This permission is optional. -->
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<!-- GCM permissions -->
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<supports-screens
android:anyDensity="true"
android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true" />
<application
android:name="DubaiGoldPriceApplication"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity
android:name=".MainActivity"
android:label="@string/app_name"
android:theme="@style/AppTheme.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<provider
android:name="android.support.v4.content.FileProvider"
android:authorities="org.chittu.dubaigoldprices.fileprovider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/filepaths" />
</provider>
<!-- The following is required -->
<!-- Include your App's API key from Apptentive at "Settings -> API & Development" -->
<meta-data
android:name="apptentive_api_key"
android:value="<APIKEY>" />
<activity
android:name="com.apptentive.android.sdk.ViewActivity"
android:theme="@style/ApptentiveTheme" />
<!-- FB integration -->
<meta-data
android:name="com.facebook.sdk.ApplicationId"
android:value="@string/facebook_app_id" />
<provider android:authorities="com.facebook.app.FacebookContentProvider<SDKID>"
android:name="com.facebook.FacebookContentProvider"
android:exported="true"/>
<activity
android:name="com.facebook.FacebookActivity"
android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"
android:label="@string/app_name"
android:theme="@android:style/Theme.Translucent.NoTitleBar" />
<!-- [START gcm_receiver] -->
<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="org.chittu.dubaigoldprices" />
</intent-filter>
</receiver>
<!-- [END gcm_receiver] -->
<!-- [START gcm_listener] -->
<service
android:name="org.chittu.dubaigoldprices.MyGcmListenerService"
android:exported="false" >
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
</intent-filter>
</service>
<!-- [END gcm_listener] -->
<!-- [START instanceId_listener] -->
<service
android:name="org.chittu.dubaigoldprices.MyInstanceIDListenerService"
android:exported="false">
<intent-filter>
<action android:name="com.google.android.gms.iid.InstanceID"/>
</intent-filter>
</service>
<!-- [END instanceId_listener] -->
<service
android:name="org.chittu.dubaigoldprices.RegistrationIntentService"
android:exported="false">
</service>
</application>