简体   繁体   中英

HOWTO? iOS Device to Device Google Cloud Messaging

I managed to get GCM setup in iOS yesterday. I was also able to test sending a message directory to my test device.

Today I was going to generalize all this so the iOS app I'm working on could interoperate with the Android counter part via GCM.

That's when I started to get confused.

The iOS GCM Cocoapod provides a couple sendMessage API's that appear to use

SENDER_ID@gcm.googleapis.com, 

where the SENDER_ID is

"A sender ID is a project number acquired from the API console,"

I don't see how that is going to work. The Android version uses registrationid's via a http protocol to send messages. Is that what I need to use?

Any thoughtful guidance?

Thanks

GCM on Android and iOS are similar in how they identify specific devices. In both cases the client needs to register with GCM, in doing so it gets a registration ID and that is used to send messages directly to a specific device.

In your case have a look at the callback after registration occurs, you should have a registrationToken that can be used to identify the device for GCM messages.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM