Mulgard
Mulgard

Reputation: 10589

Does GCM requires Internet Connection?

Im using GCM to get Notifications for my Android App. When registering at GCM you have to call:

@Override
protected String doInBackground(Void... params) {
    String registrationID = "";
    GoogleCloudMessaging gcmObject = null;

    try {
        gcmObject = GoogleCloudMessaging.getInstance(this.context);
        registrationID = gcmObject.register(Globals.GOOGLE_PROJECT_ID);
    } catch(IOException e) {
        registrationID = null;
    }

    return registrationID;
}

Is it neccessary to have connection to the internet for that call? Im asking because i have problems in my intranet where i test my application.

Upvotes: 0

Views: 530

Answers (2)

TootsieRockNRoll
TootsieRockNRoll

Reputation: 3288

Yes you do need internet because there is a call to register your device so you can get your GCM token

Upvotes: 2

Eran
Eran

Reputation: 393841

Yes, of course it requires internet connection. The registration process (the call to gcmObject.register) sends a request to the GCM server, so you must have a connection.

Upvotes: 1

Related Questions