2012-03-19 9 views
1

をクリックしたときに、私はアーバン飛行船ライブラリを使用してプッシュ通知を実装していますと呼ばれるばかりではありません。テストプッシュ通知からプッシュ通知を受け取ることができます。私は、プッシュ通知、アラートの表示、すなわちアクションボタンをクリックしたときに今、私のアプリは、いずれかのバックdidFinishLaunchingWithOptionとapplicationDidBecomeActiveでコールを取得することが、できなく起動します。私はテストのプッシュを使用して、任意の通知を受信し、[表示]ボタンをクリックの上に私のアプリを立ち上げますが、didFinishLaunchingWithOptionが呼び出さなっていないときにここでdidFinishLaunchingWithOptionは、プッシュ通知のアクションボタンが

// Check if App running in Simulator. 
     [self failIfSimulator]; 

     NSDictionary *remoteNotification = [launchOptions objectForKey:UIApplicationLaunchOptionsRemoteNotificationKey]; 

     if (remoteNotification != nil) { 
      NSString *message = [remoteNotification descriptionWithLocale:nil indent: 1]; 
      NSLog(@"Message in didFinishLaunchingWithOptions: %@",message); 
     } 

     //Init Airship launch options 
     NSMutableDictionary *takeOffOptions = [[[NSMutableDictionary alloc] init] autorelease]; 
     [takeOffOptions setValue:launchOptions forKey:UAirshipTakeOffOptionsLaunchOptionsKey]; 

     // Create Airship singleton that's used to talk to Urban Airship servers. 
     // Please populate AirshipConfig.plist with your info from http://go.urbanairship.com 
     [UAirship takeOff:takeOffOptions]; 

     // Register for notifications 
     [[UIApplication sharedApplication] 
     registerForRemoteNotificationTypes:(UIRemoteNotificationTypeBadge | 
              UIRemoteNotificationTypeSound | 
              UIRemoteNotificationTypeAlert)]; 

は今、私は私のdidFinishLaunchingWithOptionで、これまでにやっているものです。私は何かを逃していますか?また、通知を表示すると、私は自分自身を表示したい。

もし私が何かを見逃している場合は、私を案内してください。また、いくつかのサンプル、リンクが役に立つかもしれません。 ありがとうございます...

答えて

2

多分、アプリは既に起動していますか?

application:didReceiveRemoteNotification: 

ここには、アプリが既に起動されていても通知が届きます。

+0

おかげで男性....このアプリはすでに起動されたときに呼び出され...またdidFinishLaunchingWithOptionsは、アクションボタンに呼び出されます..私は警告ダイアログを追加し、アプリケーションを実行して、コールバックのとき...おかげで解決を取得しているです.. – Panache