2013-07-11 3 views
0

iPhone에서 도시용 비행선 (개발)을 사용하여 푸시 알림을 구현했습니다.도시용 비행선, 기기 토큰이 null입니다.

잘 작동합니다. 새 기기에서 테스트하고 싶습니다. 새 Mac PC에서 새 장치에 동일한 프로젝트를 설치했습니다. 키 체인에 인증서를 추가하고 실행했지만 로그에 장치 토큰이 null이고 도시 대시 보드에 새 장치 토큰이 없음을 보여줍니다.

null 디바이스 토큰의 이유는 무엇입니까? 뭔가 빠져 있니? .p12 파일로 뭔가할까요?

나는이 didFinishLaunchingWithOptions에있다 : 당신이 나에게 당신이 null 값을 참조 할

답변

0

을 도울 수있는 희망 didRegisterForRemoteNotificationsWithDeviceToken

- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken { 


    UA_LINFO(@"APNS device token: %@", deviceToken); 
    // Updates the device token and registers the token with UA. 
    [[UAPush shared] registerDeviceToken:deviceToken]; 

} 

여기

// Get the results out to open or close notification 
    bool storedresult = [defaults boolForKey:airShipKey]; 

    if(storedresult){ 
     [UAPush shared].pushEnabled=YES; 
    }else{ 
     [UAPush shared].pushEnabled=NO; 
    } 


    // Override point for customization after application launch. 
    //Create Airship options directory and add the required UIApplication launchOptions 
    NSMutableDictionary *takeOffOptions = [NSMutableDictionary dictionary]; 
    [takeOffOptions setValue:launchOptions forKey:UAirshipTakeOffOptionsLaunchOptionsKey]; 

    // Call takeOff (which creates the UAirship singleton), passing in the launch options so the 
    // library can properly record when the app i launched from a push notification. This call is 
    // required. 
    // 
    // Populate AirshipConfig.plist with your app's info from https://go.urbanairship.com 
    [UAirship takeOff:takeOffOptions]; 

    // Set the icon badge to zero on startup (optional) 
    [[UAPush shared] resetBadge]; 



    [[UAPush shared] 
    registerForRemoteNotificationTypes:(UIRemoteNotificationTypeBadge | 
             UIRemoteNotificationTypeSound | 
             UIRemoteNotificationTypeAlert)]; 

    // Handle any incoming incoming push notifications. 
    // This will invoke `handleBackgroundNotification` on your UAPushNotificationDelegate. 
    [[UAPush shared] handleNotification:[launchOptions valueForKey:UIApplicationLaunchOptionsRemoteNotificationKey] 
         applicationState:application.applicationState]; 

을하고있다? 어번 비행선 대시 보드, 또는이 방법에서있어서, 상기 엑스 코드 로그에서

- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)newDeviceToken

+0

...에 .. 그 – Twinkle

+0

수 = ""속성의리스트 및 그들 중 하나의 장치 토큰 JSON 나를 준다 이 방법에 대한 코드를 게시 하시겠습니까? – bachonk

+0

너무 오래 .. 아래에 게시했습니다. – Twinkle

관련 문제