0

I'm developing a quickblox application using Adobe AIR, which forces me to use the REST Api instead of the native libraries. I can't get the push notifications to work for offline Messages or the admin panel. Here's the details of what I do:

Admin panel:

  1. uploaded Apple certificates for both Devel and Production push notifications
  2. Setup project ID and server key for GCM

on Application Activate:

Register with APNS. Get device token:

XXXXXXX1fd86e783c1410e9b9e41e9f11339e33f17f59bfcc7d6bf9XXXXXXXXX

Generate udid for device. This is not Apple's device UDID, since it is now deprecated. I generate one myself. I'm saying this just in case this could be the problem

Login to Quickblox as user with device info

POST

{
    "auth_key":"XXXXXXXXXX",
    "nonce":8072,
    "user":{
        "password":"XXXXXXX",
        "login":"XXXXXX"
        },
    "application_id":"1563",
    "timestamp":1363692198,
    "device":{
        "platform":"ios",
        "udid":"71B18699-E1A3-13B6-F8C3-BDBF01AC1FFC-B4B3475569E9-6B6A-A27E-56D1-B73E0ED4"
        },
    "signature":"d61293bbd98d2e523952c0f30e44ec514fb7f86a"
}

Login is ok. Create push token. As client_identification_sequence I use the token retrieved from Apple

POST

{

    "push_token":{
        "environment":"development",
        "client_identification_sequence":"XXXXXXX1fd86e783c1410e9b9e41e9f11339e33f17f59bfcc7d6bf9XXXXXXXXX"
        },
    "device":{
        "platform":"ios",
        "udid":"71B18699-E1A3-13B6-F8C3-BDBF01AC1FFC-B4B3475569E9-6B6A-A27E-56D1-B73E0ED4"
        }
}   

Quickblox returns a token 153323 so I assume everything is ok

Now create subscription

POST

{

    "notification_channels":"apns"  

}

Quickblox returns the following

[
    {
        "subscription":{
            "device":{
                "udid":"71B18699-E1A3-13B6-F8C3-BDBF01AC1FFC-B4B3475569E9-6B6A-A27E-56D1-B73E0ED4",
                "platform":{
                    "name":"ios"
                    }
                },
            "id":167704,
            "notification_channel":{
                "name":"apns"
                }
        }
    }
]

UDid matches udid I passed from login. Everything looks good

Now I go to Admin panel and try to send Message. Admin panel says:

Notification has been successfully added to queue

If I go to queue, message shows as 'sent' but I never receive the notification in my device.

Any help would be greatly appreciated

4

1 に答える 1

0

あなたのコードは見栄えがよく、

いくつかのコメント:

1) 合格する必要はありません

"device":{
        "platform":"ios",
        "udid":"71B18699-E1A3-13B6-F8C3-BDBF01AC1FFC-B4B3475569E9-6B6A-A27E-56D1-B73E0ED4"
        },

プッシュトークンの作成中にパラメーターを渡すため、セッションへのパラメーター

2) udid - ユーザーは複数のデバイスを持つことができるため、ユーザーのデバイスを分離するだけです。したがって、ユーザーの特定のデバイスを一意に識別する「udid」に任意の値を渡すことができます

3) 管理パネルからメッセージを送信した場合 - クライアント側ですべて問題ないと思います。そのため、APNS 証明書を確認して、再アップロードしてください。

于 2013-03-25T14:25:49.200 に答える