下面的详细信息,但基本上我正在试图了解我的Droid上发生了什么错误.
细节:我正在努力加快C2DM的速度.我正在测试使用Urban Airship的推送通知服务(目前为止非常酷的IMO)通过C2DM向Android上运行的应用程序发送通知.
我的Droid(运行Android 2.2.2)不显示通知,每次我认为在设备上收到通知时,我都会看到写入LogCat的堆栈跟踪.
我不知道是什么产生了堆栈跟踪.我知道每当我通过Urban Airship的网站向设备发送推送通知时,它就会生成.
我非常确定我已经正确配置了我的C2DM,Urban Airship和Android应用程序,因为我可以在Android模拟器上使用相同的应用程序和Google帐户成功接收和显示通知.仅供参考 - Android应用程序是Urban Airship的示例Android推送应用程序,使用我的配置信息进行编辑.
由于它在Android模拟器中工作并且在我的实际设备上失败,我假设我的设备有一些导致它失败的东西.因此,对下面的堆栈跟踪感兴趣.
11-11 16:15:28.894: E/TalkProvider(4433): query db caught
11-11 16:15:28.894: E/TalkProvider(4433): java.lang.IllegalArgumentException: the bind value at index 2 is null
11-11 16:15:28.894: E/TalkProvider(4433): at android.database.sqlite.SQLiteProgram.bindString(SQLiteProgram.java:234)
11-11 16:15:28.894: E/TalkProvider(4433): at android.database.sqlite.SQLiteQuery.bindString(SQLiteQuery.java:182)
11-11 16:15:28.894: E/TalkProvider(4433): at android.database.sqlite.SQLiteDirectCursorDriver.query(SQLiteDirectCursorDriver.java:48)
11-11 16:15:28.894: E/TalkProvider(4433): at android.database.sqlite.SQLiteDatabase.rawQueryWithFactory(SQLiteDatabase.java:1345)
11-11 16:15:28.894: E/TalkProvider(4433): at android.database.sqlite.SQLiteQueryBuilder.query(SQLiteQueryBuilder.java:330)
11-11 16:15:28.894: E/TalkProvider(4433): at com.google.android.gsf.talk.TalkProvider.queryInternal(TalkProvider.java:1740)
11-11 16:15:28.894: E/TalkProvider(4433): at com.google.android.gsf.talk.TalkProvider.query(TalkProvider.java:1436)
11-11 16:15:28.894: E/TalkProvider(4433): at android.content.ContentProvider$Transport.query(ContentProvider.java:163)
11-11 16:15:28.894: E/TalkProvider(4433): at android.content.ContentResolver.query(ContentResolver.java:245)
11-11 16:15:28.894: E/TalkProvider(4433): at …
Run Code Online (Sandbox Code Playgroud) 我的代码在Applicaion.onCreate中.应用程序在UAirship.takeoff(this,options);
请求帮助时崩溃.
public class LiveVideoApplication extends Application {
@Override
public void onCreate() {
super.onCreate();
AirshipConfigOptions options = AirshipConfigOptions.loadDefaultOptions(this);
// Optionally, customize your config at runtime:
//
options.inProduction = false;
options.developmentAppKey = "key.. ";
options.developmentAppSecret = "secret..";
UAirship.takeOff(this, options);
PushManager.shared().setIntentReceiver(IntentReceiver.class);
Logger.logLevel = Log.VERBOSE;
//use CustomPushNotificationBuilder to specify a custom layout
CustomPushNotificationBuilder nb = new CustomPushNotificationBuilder();
nb.statusBarIconDrawableId = R.drawable.icon_small;//custom status bar icon
//
nb.layout = R.layout.notification;
nb.layoutIconDrawableId = R.drawable.icon;//custom layout icon
nb.layoutIconId = R.id.icon;
nb.layoutSubjectId = R.id.subject;
nb.layoutMessageId = R.id.message;
// …
Run Code Online (Sandbox Code Playgroud) 我试图在我的iOS应用程序中集成推送通知.这是一个Phonegap/Cordova项目.没有APNS和Urban Airship,一切运作良好.
我到现在为止做了什么?我得到了它的工作,我可以从UA向我的手机发送推送消息,但这是通过不同论坛的示例代码完成的,而不是UA文档.所以我开始像在UA的文档中那样做.我非常困惑,尝试了很多.
所以我做了以下操作:从UA获取Push Sample并将代码复制到AppDelegate.m,现在看起来像这样:
// Create Airship singleton that's used to talk to Urban Airhship servers.
// Please populate AirshipConfig.plist with your info from http://go.urbanairship.com
[UAirship takeOff:takeOffOptions];
[[UAPush shared] resetBadge];//zero badge on startup
[[UAPush shared] registerForRemoteNotificationTypes:(UIRemoteNotificationTypeBadge |
UIRemoteNotificationTypeSound |
UIRemoteNotificationTypeAlert)];
return YES;
}
- (void)applicationDidBecomeActive:(UIApplication *)application {
UALOG(@"Application did become active.");
[[UAPush shared] resetBadge]; //zero badge when resuming from background (iOS 4+)
}
- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
UALOG(@"APN device token: %@", deviceToken);
// Updates the device token …
Run Code Online (Sandbox Code Playgroud) 我正在使用Urban Airship并使用他们的REST API进行测试.我已Google Cloud Messaging
连接到Urban Airship帐户,并且已成功注册一个Android设备.
我可以从Urban Airship仪表板上的界面成功发送测试消息.
但是当我尝试https://go.urbanairship.com/api/push/
在身体上使用REST API 时
{
"audience" : "all" ,
"device_types" : "all",
"notification" : {
"android": {
"alert" : "This is a broadcast."
}
}
}
Run Code Online (Sandbox Code Playgroud)
我收到400 Bad Request
回复This app is not configured for iOS push
知道为什么吗?
更新:列出"audience"部分中的特定设备APID返回相同的结果
android push-notification urbanairship.com google-cloud-messaging
我一直在阅读有关此错误的所有其他问题,似乎我已经按照他们的解决方案但我仍然遇到这个问题.我删除了所有现有的配置文件和应用ID.我创建了一个已启用推送的新应用ID.我创建了一个启用了推送的开发配置文件.在Apple开发站点上,该配置文件旁边有一个绿色的"活动"指示符.在xcode5中,在首选项>帐户下,列出了配置文件.在窗口>管理器下,配置配置文件显示在我的设备下,状态为"有效配置文件".但错误仍在发生.我在这里错过了什么?
编辑:我想明确表示我在创建APNS证书后创建了配置文件,因为这似乎是最常见的解决方案.
你好,我希望有人可以帮助我.
我正在开发一个使用UrbanAirship接收的应用程序PushNotifications
.
我的问题是,从今天早上开始,当使用takeOff初始化UrbanAirship时,我的应用程序崩溃了.
我正在使用Android Studio v2.1.1(稳定版)并更新了我的Build和Platform-Tools以使用最新版本.崩溃发生后,我通过使用旧版本的这些工具和不同的Android Studio版本(2.0,1.3和1.5)来测试它是否是由新工具引起的.所以我相信不应该是问题.
这是我使用的代码和我的LogCat中的堆栈跟踪:
UAirship.takeOff(this, Config.getOptions(), mAirshipReadyCallback);
Run Code Online (Sandbox Code Playgroud)
getOptions返回以下内容:
public static AirshipConfigOptions getOptions() {
return new AirshipConfigOptions.Builder()
.setDevelopmentAppKey("Key")
.setDevelopmentAppSecret("Secret")
.setProductionAppKey("Key")
.setProductionAppSecret("Secret")
.setInProduction(!BuildConfig.DEBUG)
.setGcmSender("Sender")
.setProductionLogLevel(3).build();
}
Run Code Online (Sandbox Code Playgroud)
我的回调如下:
private UAirship.OnReadyCallback mAirshipReadyCallback = new UAirship.OnReadyCallback() {
@Override
public void onAirshipReady(UAirship uAirship) {
DefaultNotificationFactory notificationFactory;
notificationFactory = new DefaultNotificationFactory(getApplicationContext());
notificationFactory.setSmallIconId(R.drawable.ic_push);
notificationFactory.setLargeIcon(R.drawable.ic_launcher);
try {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
notificationFactory.setColor(getColor(R.color.main_list_item_text_enabled));
} else {
notificationFactory.setColor(getResources().getColor(R.color.main_list_item_text_enabled));
}
} catch (Resources.NotFoundException ex) {
Timber.e(ex.getCause(), ex.getMessage());
notificationFactory.setColor(Color.parseColor("0e457e"));
}
// Enable user notifications
Timber.i("Enable Airship!"); …
Run Code Online (Sandbox Code Playgroud) 我有一个非常简单的问题,搜索没有引导我得到答案.在我的应用程序中:didFinishLaunchingWithOptions方法我执行以下操作来恢复程序未运行时进入的通知:
//Init Airship launch options
NSMutableDictionary *takeOffOptions = [[[NSMutableDictionary alloc] init] autorelease];
[takeOffOptions setValue:launchOptions forKey:UAirshipTakeOffOptionsLaunchOptionsKey];
[UAirship takeOff:takeOffOptions];
[UAPush shared].delegate = self;
[[UAPush shared] resetBadge];
// Register for notifications through UAPush for notification type tracking
[[UAPush shared] registerForRemoteNotificationTypes:(UIRemoteNotificationTypeBadge |
UIRemoteNotificationTypeSound |
UIRemoteNotificationTypeAlert)];
Run Code Online (Sandbox Code Playgroud)
当程序运行时(在前台或后台)我可以恢复我的飞艇警报:
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo
{
NSLog(@"\nReceived remote notification:\n%@\n\n", userInfo);
[[UAPush shared] handleNotification:userInfo applicationState:application.applicationState];
[[UAPush shared] resetBadge]; // zero badge after push received
NSString *alertMessage = [[userInfo objectForKey:@"aps"] valueForKey:@"alert"];
}
Run Code Online (Sandbox Code Playgroud)
我的问题是:当程序在前台或后台运行时,从程序未运行时发送的消息中的launchOptions,我可以执行什么命令序列来从userInfo中提取在alertMessage中获取的相同信息?提前致谢 :)
我收到关于Urban Airship的错误消息.
Apple Push service rejected device token 38A69702F555A3B17F73FB4DB835C0E5 AD31ED987030202AADF45C5170C9EFDC.
Original Message: {"aps":{"sound":"cat.caf","badge":4,"alert":"This is Test Message."}}
Run Code Online (Sandbox Code Playgroud)
并且它显示INACTIVE
此特定设备令牌的状态.
可能有什么不对?
有人可以帮我解决这个问题,我面临的问题是什么,为什么我会遇到这种错误.
UALib:PackageManager不知道com.google.android.c2dm.permission.RECEIVE所需的权限.
我正在使用android urbanirship SDK进行推送通知,在模拟器上运行.它没有给PUSH APID:
the manifest file looks like this
<?xml version="1.0" encoding="utf-8"?>enter code here
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
android:versionCode="1"
android:versionName="1.0" package="com.younix.push.sample">
<!-- minSdkVersion sets runtime compatibility ("will run on API level 4") -->
<!-- targetSdkVersion should be set to the latest version tested, to disable compatibility modes
("was tested with API level 9 features") -->
<uses-sdk android:minSdkVersion="4"
android:targetSdkVersion="9"/>
<!-- REQUIRED PERMISSIONS (for Urban Airship GCM) -->
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.VIBRATE"/>
<uses-permission android:name="android.permission.GET_ACCOUNTS" /><!-- GCM requires a Google …
Run Code Online (Sandbox Code Playgroud) 我正在我的 iOS 移动应用程序中进行 Urban Airship 集成。推送通知工作正常,但是当我尝试打电话时
UAirship.namedUser().identifier = name
UAirship.push().updateRegistration()
Run Code Online (Sandbox Code Playgroud)
我们收到错误
无法将命名用户与状态关联:403
push-notification apple-push-notifications urbanairship.com ios swift
urbanairship.com ×10
android ×5
cordova ×2
ios ×2
iphone ×2
android-c2dm ×1
cocoa-touch ×1
ios4 ×1
objective-c ×1
push ×1
swift ×1
xcode ×1
xcode5 ×1