应用程序无权发送到该设备:城市飞艇android中的折叠计数:2
我在城市飞艇上工作,用我的应用程序发送推送通知。在设备中安装了我的应用程序后,从我的城市飞艇网络帐户进行了推送测试。此时可以接收推送通知 但在登录到域和用户页面后,尝试从上述相同的过程中推送。但无法获取推送通知 在城市飞艇web帐户页面中,错误控制台显示“应用程序无权发送到此设备:折叠计数:2”“原始消息:错误:发件人ID不匹配”错误 有人能帮忙吗 我的应用程序清单文件应用程序无权发送到该设备:城市飞艇android中的折叠计数:2,android,push-notification,urbanairship.com,Android,Push Notification,Urbanairship.com,我在城市飞艇上工作,用我的应用程序发送推送通知。在设备中安装了我的应用程序后,从我的城市飞艇网络帐户进行了推送测试。此时可以接收推送通知 但在登录到域和用户页面后,尝试从上述相同的过程中推送。但无法获取推送通知 在城市飞艇web帐户页面中,错误控制台显示“应用程序无权发送到此设备:折叠计数:2”“原始消息:错误:发件人ID不匹配”错误 有人能帮忙吗 我的应用程序清单文件 <supports-screens android:largeScreens="true" androi
<supports-screens
android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="false"
android:xlargeScreens="true" >
</supports-screens>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.GET_TASKS" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<!-- below permission added for mixpanel api -->
<uses-permission android:name="android.permission.BLUETOOTH" />
<!-- for cloud to device messaging -->
<permission
android:name="com.iw.show.permission.C2D_MESSAGE"
android:protectionLevel="signature" />
<uses-permission android:name="com.iw.show.permission.C2D_MESSAGE" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<application
android:name="com.iw.show.MyApplication"
android:hardwareAccelerated="true"
android:icon="@drawable/icon"
android:label="@string/app_name"
android:largeHeap="true" >
<activity
android:name="com.iw.show.SplashActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:screenOrientation="portrait"
android:theme="@android:style/Theme.Holo.NoActionBar" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.iw.show.DomainActivity"
android:alwaysRetainTaskState="true"
android:configChanges="keyboardHidden|orientation|screenSize"
android:isScrollContainer="false"
android:theme="@android:style/Theme.Black.NoTitleBar"
android:windowSoftInputMode="adjustPan" >
</activity>
<activity
android:name="com.iw.show.UploadHome"
android:alwaysRetainTaskState="true"
android:configChanges="keyboardHidden|orientation|screenSize"
android:hardwareAccelerated="true"
android:theme="@android:style/Theme.Black.NoTitleBar"
android:windowSoftInputMode="adjustPan" >
</activity>
<activity
android:name="com.iw.show.FilePickerActivity"
android:alwaysRetainTaskState="true"
android:configChanges="keyboardHidden|orientation|screenSize"
android:theme="@android:style/Theme.Black.NoTitleBar" >
</activity>
<activity
android:name="com.iw.show.TempMediaPlayer"
android:configChanges="keyboardHidden|orientation|screenSize"
android:theme="@android:style/Theme.Black.NoTitleBar" >
</activity>
<activity
android:name="com.iw.show.UploadResult"
android:alwaysRetainTaskState="true"
android:configChanges="keyboardHidden|orientation|screenSize"
android:theme="@android:style/Theme.Black.NoTitleBar" >
<intent-filter>
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="audio/*" />
<data android:mimeType="image/*" />
<data android:mimeType="video/*" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.SEND_MULTIPLE" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="audio/*" />
<data android:mimeType="image/*" />
<data android:mimeType="video/*" />
</intent-filter>
</activity>
<activity
android:name="com.iw.show.ThumbActivity"
android:alwaysRetainTaskState="true"
android:configChanges="keyboardHidden|orientation|screenSize|screenLayout"
android:hardwareAccelerated="true"
android:theme="@android:style/Theme.Black.NoTitleBar" >
</activity>
<activity
android:name="com.iw.show.SlideShowActivity"
android:alwaysRetainTaskState="true"
android:configChanges="keyboardHidden|orientation|screenSize"
android:theme="@android:style/Theme.Holo.NoActionBar" >
</activity>
<activity
android:name="com.iw.show.PreviewActivity"
android:alwaysRetainTaskState="true"
android:configChanges="keyboardHidden|orientation|screenSize"
android:theme="@android:style/Theme.Black.NoTitleBar" >
</activity>
<activity
android:name="com.iw.show.LoginActivity"
android:alwaysRetainTaskState="true"
android:isScrollContainer="true"
android:theme="@android:style/Theme.Black.NoTitleBar"
android:windowSoftInputMode="adjustPan" >
</activity>
<activity
android:name="com.iw.show.ForgotPasswordActivity"
android:alwaysRetainTaskState="true"
android:configChanges="keyboardHidden|orientation|screenSize"
android:theme="@android:style/Theme.Dialog" >
</activity>
<activity
android:name="com.iw.show.BecomeaMemberActivity"
android:alwaysRetainTaskState="true"
android:configChanges="keyboardHidden|orientation|screenSize"
android:theme="@android:style/Theme.Dialog" >
</activity>
<activity
android:name="com.iw.show.DomainExpiredActivity"
android:alwaysRetainTaskState="true"
android:configChanges="keyboardHidden|orientation|screenSize"
android:theme="@android:style/Theme.Translucent.NoTitleBar" >
</activity>
<activity
android:name="com.iw.show.MediaPlayerActivity"
android:alwaysRetainTaskState="true"
android:configChanges="keyboardHidden|orientation|screenSize"
android:theme="@android:style/Theme.Holo.NoActionBar" >
</activity>
<activity
android:name="com.iw.show.ShareActivity"
android:alwaysRetainTaskState="true"
android:configChanges="keyboardHidden|orientation|screenSize"
android:theme="@android:style/Theme.Black.NoTitleBar"
android:windowSoftInputMode="adjustPan" >
</activity>
<activity
android:name="com.iw.show.ShareSendAgainActivity"
android:alwaysRetainTaskState="true"
android:configChanges="keyboardHidden|orientation|screenSize"
android:theme="@android:style/Theme.Black.NoTitleBar" >
</activity>
<activity
android:name="com.iw.show.MenuActivity"
android:theme="@android:style/Theme.Black.NoTitleBar" >
</activity>
<activity
android:name="com.iw.show.ViewShowList"
android:alwaysRetainTaskState="true"
android:configChanges="keyboardHidden|orientation|screenSize"
android:launchMode="singleTop"
android:theme="@android:style/Theme.Black.NoTitleBar" >
<intent-filter>
<data
android:host="*.showontherun.com"
android:scheme="http" />
<data
android:host="*.showonthecloud.com"
android:scheme="http" />
<category android:name="android.intent.category.DEFAULT" />
<action android:name="android.intent.action.VIEW" />
<action android:name="android.intent.action.ALL_APPS" />
</intent-filter>
</activity>
<activity
android:name="com.iw.show.ShowInfoPage"
android:alwaysRetainTaskState="true"
android:configChanges="keyboardHidden|orientation|screenSize"
android:theme="@android:style/Theme.Black.NoTitleBar" >
</activity>
<activity
android:name="com.iw.show.SupportActivity"
android:alwaysRetainTaskState="true"
android:configChanges="keyboardHidden|orientation|screenSize"
android:theme="@android:style/Theme.NoTitleBar"
android:windowSoftInputMode="adjustPan" >
</activity>
<activity
android:name="com.iw.sotc.show.offline.ViewOfflineShows"
android:alwaysRetainTaskState="true"
android:configChanges="keyboardHidden|orientation|screenSize"
android:theme="@android:style/Theme.NoTitleBar"
android:windowSoftInputMode="adjustPan" >
</activity>
<activity
android:name="com.iw.sotc.show.offline.ViewOfflineThumbActivity"
android:alwaysRetainTaskState="true"
android:configChanges="keyboardHidden|orientation|screenSize"
android:theme="@android:style/Theme.NoTitleBar"
android:windowSoftInputMode="adjustPan" >
</activity>
<activity
android:name="com.iw.sotc.show.offline.ViewOfflinePreviewPage"
android:alwaysRetainTaskState="true"
android:configChanges="keyboardHidden|orientation|screenSize"
android:theme="@android:style/Theme.NoTitleBar"
android:windowSoftInputMode="adjustPan" >
</activity>
<activity
android:name="com.iw.sotc.show.offline.SlideShowOfflineActivity"
android:alwaysRetainTaskState="true"
android:configChanges="keyboardHidden|orientation|screenSize"
android:theme="@android:style/Theme.Holo.NoActionBar"
android:windowSoftInputMode="adjustPan" >
</activity>
<activity
android:name="com.iw.sotc.dialog.SaveShowDialogActivity"
android:alwaysRetainTaskState="true"
android:configChanges="keyboardHidden|orientation|screenSize"
android:theme="@android:style/Theme.Dialog"
android:windowSoftInputMode="adjustPan" >
</activity>
<activity
android:name="org.acra.CrashReportDialog"
android:excludeFromRecents="true"
android:finishOnTaskLaunch="true"
android:launchMode="singleInstance"
android:theme="@style/InfoDialog" >
</activity>
<service android:name="com.iw.sotc.show.offline.DownloadService" >
</service>
<service android:name="com.iw.show.DownloadActivityPreviewActivity" >
</service>
<service android:name="com.iw.show.MediaPlayerService" >
</service>
<service android:name="com.iw.show.UploadingService" >
</service>
<service android:name="com.iw.show.UploadLinkService" >
</service>
<activity
android:name="com.iw.show.UploadMedia"
android:alwaysRetainTaskState="true"
android:configChanges="keyboardHidden|orientation"
android:label="@string/title_activity_upload_media"
android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen" >
</activity>
<activity
android:name="com.iw.show.MediaPlayer"
android:alwaysRetainTaskState="true"
android:label="@string/title_activity_media_player" >
</activity>
<!--
added by Karthikeyan V
for managing the mixpanel api survey
-->
<activity android:name="com.mixpanel.android.surveys.SurveyActivity" />
<meta-data
android:name="com.mixpanel.android.MPConfig.AutoCheckForSurveys"
android:value="false" />
<!-- added for cloud to Device(C2DM)Messaging service -->
<receiver
android:name="com.mixpanel.android.mpmetrics.GCMReceiver"
android:permission="com.google.android.c2dm.permission.SEND" >
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<category android:name="com.iw.show" />
</intent-filter>
</receiver>
<!-- < added by siva for play the audio by streaming > -->
<activity
android:name="com.iw.show.AudioStream"
android:configChanges="keyboardHidden|orientation"
android:launchMode="singleTask" >
</activity>
<!-- added for mixpanel in-app notification -->
<meta-data
android:name="com.mixpanel.android.MPConfig.AutoShowMixpanelUpdates"
android:value="false" />
<!-- Statring Urban Airship from here -->
<!-- Required for the library -->
<provider
android:name="com.urbanairship.UrbanAirshipProvider"
android:authorities="com.iw.show.urbanairship.provider"
android:exported="true"
android:multiprocess="true"
android:permission="com.iw.show.permission.UA_DATA" />
<!-- Required for Push -->
<service android:name="com.urbanairship.push.PushService" />
<receiver android:name="com.urbanairship.CoreReceiver" />
<receiver
android:name="com.urbanairship.push.GCMPushReceiver"
android:permission="com.google.android.c2dm.permission.SEND" >
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<category android:name="com.iw.show" />
</intent-filter>
<!-- Required for detecting when the application is upgraded so it can request a new GCM ID -->
<intent-filter>
<action android:name="android.intent.action.PACKAGE_REPLACED" />
<data android:scheme="com.iw.show" />
</intent-filter>
</receiver>
<!-- Required for analytics -->
<service android:name="com.urbanairship.analytics.EventService" />
<!-- Required for Rich Push -->
<service android:name="com.urbanairship.richpush.RichPushUpdateService" />
<!-- Required for Actions -->
<activity android:name="com.urbanairship.actions.ActionActivity" />
<service android:name="com.urbanairship.actions.ActionService" />
<!-- Required for Landing Page Action -->
<activity
android:name="com.urbanairship.actions.LandingPageActivity"
android:exported="false"
android:parentActivityName="com.iw.show.SplashActivity" >
<!-- MODIFICATION REQUIRED set or remove the parent activity -->
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.iw.show.SplashActivity" />
<intent-filter>
<action android:name="com.urbanairship.actions.SHOW_LANDING_PAGE_INTENT_ACTION" />
<data android:scheme="http" />
<data android:scheme="https" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<receiver android:name="com.iw.show.IntentReceiver" />
<!-- upto the above line -->
</application>
}
还有我的IntentReceiver.java
public class IntentReceiver extends BroadcastReceiver {
// A set of actions that launch activities when a push is opened. Update
// with any custom actions that also start activities when a push is opened.
private static String[] ACTIVITY_ACTIONS = new String[] {
DeepLinkAction.DEFAULT_REGISTRY_NAME,
OpenExternalUrlAction.DEFAULT_REGISTRY_NAME,
LandingPageAction.DEFAULT_REGISTRY_NAME };
public static String notify_url = null;
private String TAG = "IntentReceiver";
@Override
public void onReceive(Context context, Intent intent) {
if (Constants.DEBUG) {
notify_url = intent.getStringExtra("shared url");
if(notify_url != null)
Log.d("IntentReceiver", "Intent receiver data :" + notify_url);
Bundle bundle = intent.getExtras();
Log.d("IntentReceiver", "android value in received bundle :"
+ bundle.get("com.urbanairship.push.ALERT"));
Log.d("IntentReceiver", "Json possible data 1:" + bundle);
Log.d("IntentReceiver",
"Json possible data 2:" + intent.getStringExtra("alert"));
Log.d("IntentReceiver",
"Json possible data 3:" + intent.getStringExtra("apids"));
}
if (Constants.DEBUG)
Log.d("IntentReceiver", "called IntentReceiver onReceive method");
/*for (int i = 0; i < ACTIVITY_ACTIONS.length; i++)
if (ACTIVITY_ACTIONS[i]
.equals(PushManager.ACTION_REGISTRATION_FINISHED)) {
Log.i(TAG,
"Registration complete. APID:"
+ intent.getStringExtra(PushManager.EXTRA_APID)
+ ". Valid: "
+ intent.getBooleanExtra(
PushManager.EXTRA_REGISTRATION_VALID,
false));
// Notify any app-specific listeners
MyApplication.APID = PushManager.shared().getAPID();
if(Constants.DEBUG)
Log.d(TAG,"APID in MyApplication in Intent Receiver :"+MyApplication.APID);
Intent launch = new Intent(UAirship.getPackageName()
+ PushManager.A);
UAirship.shared().getApplicationContext().sendBroadcast(launch);
}*/
if (PushManager.ACTION_PUSH_RECEIVED.equals(intent.getAction())) {
// Push received
} else if (PushManager.ACTION_NOTIFICATION_OPENED.equals(intent
.getAction())) {
// Push opened
// Only launch the main activity if the payload does not contain any
// actions that might have already opened an activity
if(notify_url != null)
{
if (!ActionUtils.containsRegisteredActions(intent.getExtras(),
ACTIVITY_ACTIONS))
{
Intent launch = new Intent(Intent.ACTION_MAIN);
launch.setClass(context, ViewShowList.class);
launch.setData(Uri.parse(notify_url));
launch.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK
| Intent.FLAG_ACTIVITY_CLEAR_TASK);
context.startActivity(launch);
}
}
else
{
if (!ActionUtils.containsRegisteredActions(intent.getExtras(),
ACTIVITY_ACTIONS)) {
Intent launch = new Intent(Intent.ACTION_MAIN);
launch.setClass(context, ThumbActivity.class);
launch.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK
| Intent.FLAG_ACTIVITY_CLEAR_TASK);
context.startActivity(launch);
}
}
}
}
公共类IntentReceiver扩展了BroadcastReceiver{
//打开推送时启动活动的一组操作。更新
//具有任何自定义操作,在推送打开时也会启动活动。
私有静态字符串[]活动\操作=新字符串[]{
DeepLinkAction.DEFAULT\u注册表\u名称,
OpenExternalLuclaction.DEFAULT\u注册表\u名称,
LandingPageAction.DEFAULT_REGISTRY_NAME};
公共静态字符串notify_url=null;
私有字符串标记=“IntentReceiver”;
@凌驾
公共void onReceive(上下文、意图){
if(Constants.DEBUG){
notify_url=intent.getStringExtra(“共享url”);
if(notify_url!=null)
Log.d(“意向接收器”,“意向接收器数据:”+通知url);
Bundle=intent.getExtras();
Log.d(“IntentReceiver”,“收到的捆绑包中的android值:”
+bundle.get(“com.urbanairship.push.ALERT”);
Log.d(“IntentReceiver”,“Json可能数据1:+捆绑包”);
Log.d(“IntentReceiver”,
“Json可能数据2:”+intent.getStringExtra(“警报”);
Log.d(“IntentReceiver”,
“Json可能数据3:”+intent.getStringExtra(“APID”);
}
if(Constants.DEBUG)
d(“IntentReceiver”,“称为IntentReceiver onReceive方法”);
/*for(int i=0;i
}
为了你的信息,我有以下城市飞艇文件
上述文件中是否遗漏了任何内容当UrbanAirship代表您向GCM注册时,它将使用您提供给它的12位项目编号,并从谷歌获得注册ID。该注册ID与用于获取该ID的项目编号相关联 当您发送GCM消息时,您使用API密钥连接到GCM服务器(我不确定您是直接还是通过UrbanAirship进行连接,但这并不重要)。API密钥属于具有项目编号的API项目
当您尝试使用属于项目编号为a的API密钥和属于项目编号B的注册ID发送GCM消息时,会发生不匹配的发件人ID
您可能在某个时候更改了正在使用的项目编号。如果您这样做了,解决方法是清除旧的注册ID(属于旧项目编号)并获取新的注册ID。我不知道你如何清理UrbanAirship存储的注册ID(无论是本地的应用程序数据还是UrbanAirship服务器),但一定有办法。如果发件人ID不匹配意味着,我甚至无法收到一个通知。我说得对吗?!。但我可以在安装我的应用程序后,在移动到特定页面之前接收。一旦进入特定页面之后,我就无法收到任何通知。使用免费跟踪帐户有任何限制吗?@KarthikeyanVe我不知道。
public class IntentReceiver extends BroadcastReceiver {
// A set of actions that launch activities when a push is opened. Update
// with any custom actions that also start activities when a push is opened.
private static String[] ACTIVITY_ACTIONS = new String[] {
DeepLinkAction.DEFAULT_REGISTRY_NAME,
OpenExternalUrlAction.DEFAULT_REGISTRY_NAME,
LandingPageAction.DEFAULT_REGISTRY_NAME };
public static String notify_url = null;
private String TAG = "IntentReceiver";
@Override
public void onReceive(Context context, Intent intent) {
if (Constants.DEBUG) {
notify_url = intent.getStringExtra("shared url");
if(notify_url != null)
Log.d("IntentReceiver", "Intent receiver data :" + notify_url);
Bundle bundle = intent.getExtras();
Log.d("IntentReceiver", "android value in received bundle :"
+ bundle.get("com.urbanairship.push.ALERT"));
Log.d("IntentReceiver", "Json possible data 1:" + bundle);
Log.d("IntentReceiver",
"Json possible data 2:" + intent.getStringExtra("alert"));
Log.d("IntentReceiver",
"Json possible data 3:" + intent.getStringExtra("apids"));
}
if (Constants.DEBUG)
Log.d("IntentReceiver", "called IntentReceiver onReceive method");
/*for (int i = 0; i < ACTIVITY_ACTIONS.length; i++)
if (ACTIVITY_ACTIONS[i]
.equals(PushManager.ACTION_REGISTRATION_FINISHED)) {
Log.i(TAG,
"Registration complete. APID:"
+ intent.getStringExtra(PushManager.EXTRA_APID)
+ ". Valid: "
+ intent.getBooleanExtra(
PushManager.EXTRA_REGISTRATION_VALID,
false));
// Notify any app-specific listeners
MyApplication.APID = PushManager.shared().getAPID();
if(Constants.DEBUG)
Log.d(TAG,"APID in MyApplication in Intent Receiver :"+MyApplication.APID);
Intent launch = new Intent(UAirship.getPackageName()
+ PushManager.A);
UAirship.shared().getApplicationContext().sendBroadcast(launch);
}*/
if (PushManager.ACTION_PUSH_RECEIVED.equals(intent.getAction())) {
// Push received
} else if (PushManager.ACTION_NOTIFICATION_OPENED.equals(intent
.getAction())) {
// Push opened
// Only launch the main activity if the payload does not contain any
// actions that might have already opened an activity
if(notify_url != null)
{
if (!ActionUtils.containsRegisteredActions(intent.getExtras(),
ACTIVITY_ACTIONS))
{
Intent launch = new Intent(Intent.ACTION_MAIN);
launch.setClass(context, ViewShowList.class);
launch.setData(Uri.parse(notify_url));
launch.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK
| Intent.FLAG_ACTIVITY_CLEAR_TASK);
context.startActivity(launch);
}
}
else
{
if (!ActionUtils.containsRegisteredActions(intent.getExtras(),
ACTIVITY_ACTIONS)) {
Intent launch = new Intent(Intent.ACTION_MAIN);
launch.setClass(context, ThumbActivity.class);
launch.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK
| Intent.FLAG_ACTIVITY_CLEAR_TASK);
context.startActivity(launch);
}
}
}
}