Google's Cloud Messaging Network (GCM) will be used. To learn more about GCM, visit our Android or Apache Cordova guides for push.
package com.push.pushapplication; import java.net.URI; import java.net.URISyntaxException; import org.jboss.aerogear.android.unifiedpush.PushConfig; import org.jboss.aerogear.android.unifiedpush.PushRegistrar; import org.jboss.aerogear.android.unifiedpush.Registrations; import android.app.Application; public class PushApplication extends Application { private final String VARIANT_ID = "7d37fd1a-82c1-48c8-be94-6456f26075fc"; private final String SECRET = "c6dc8b14-0c6f-4f41-8835-2a87827ee1f4"; private final String GCM_SENDER_ID = "33"; private final String UNIFIED_PUSH_URL = "http://localhost:8080/ag-push/"; private PushRegistrar registration; @Override public void onCreate() { super.onCreate(); Registrations registrations = new Registrations(); try { PushConfig config = new PushConfig(new URI(UNIFIED_PUSH_URL), GCM_SENDER_ID); config.setVariantID(VARIANT_ID); config.setSecret(SECRET); config.setAlias(MY_ALIAS); registration = registrations.push("unifiedpush", config); registration.register(getApplicationContext(), new Callback() { private static final long serialVersionUID = 1L; @Override public void onSuccess(Void ignore) { Toast.makeText(MainActivity.this, "Registration Succeeded!", Toast.LENGTH_LONG).show(); } @Override public void onFailure(Exception exception) { Log.e("MainActivity", exception.getMessage(), exception); } }); } catch (URISyntaxException e) { throw new RuntimeException(e); } } }
Google's Cloud Messaging Network (GCM) will be used. To learn more about GCM, visit our Android or Apache Cordova guides for push.
package com.push.pushapplication; import java.net.URI; import java.net.URISyntaxException; import org.jboss.aerogear.android.unifiedpush.PushConfig; import org.jboss.aerogear.android.unifiedpush.PushRegistrar; import org.jboss.aerogear.android.unifiedpush.Registrations; import android.app.Application; public class PushApplication extends Application { private final String VARIANT_ID = "7d37fd1a-82c1-48c8-be94-6456f26075fc"; private final String SECRET = "c6dc8b14-0c6f-4f41-8835-2a87827ee1f4"; private final String GCM_SENDER_ID = "33"; private final String UNIFIED_PUSH_URL = "http://localhost:8080/ag-push/"; private PushRegistrar registration; @Override public void onCreate() { super.onCreate(); Registrations registrations = new Registrations(); try { PushConfig config = new PushConfig(new URI(UNIFIED_PUSH_URL), GCM_SENDER_ID); config.setVariantID(VARIANT_ID); config.setSecret(SECRET); config.setAlias(MY_ALIAS); registration = registrations.push("unifiedpush", config); registration.register(getApplicationContext(), new Callback() { private static final long serialVersionUID = 1L; @Override public void onSuccess(Void ignore) { Toast.makeText(MainActivity.this, "Registration Succeeded!", Toast.LENGTH_LONG).show(); } @Override public void onFailure(Exception exception) { Log.e("MainActivity", exception.getMessage(), exception); } }); } catch (URISyntaxException e) { throw new RuntimeException(e); } } }
This is a list of devices using this variable. To see installation instructions and code snippet click here
Device token | Device type | Categories | Alias | Reciving |
---|---|---|---|---|
9872626727621679821s878799 | iPhone | Categories one, Categories two | Alias one, Alias two | |
9872626727621679821s878799 | iPhone | Categories one, Categories two | Alias one, Alias two | |
9872626727621679821s878799 | iPhone | Categories one, Categories two | Alias one, Alias two | |
9872626727621679821s878799 | iPhone | Categories one, Categories two | Alias one, Alias two | |
9872626727621679821s878799 | iPhone | Categories one, Categories two | Alias one, Alias two | |
9872626727621679821s878799 | iPhone | Categories one, Categories two | Alias one, Alias two |
This is a list of devices using this variable. To see installation instructions and code snippet click here
Device token | Device type | Categories | Alias | Reciving |
---|---|---|---|---|
9872626727621679821s878799 | iPhone | Categories one, Categories two | Alias one, Alias two | |
9872626727621679821s878799 | iPhone | Categories one, Categories two | Alias one, Alias two | |
9872626727621679821s878799 | iPhone | Categories one, Categories two | Alias one, Alias two | |
9872626727621679821s878799 | iPhone | Categories one, Categories two | Alias one, Alias two | |
9872626727621679821s878799 | iPhone | Categories one, Categories two | Alias one, Alias two | |
9872626727621679821s878799 | iPhone | Categories one, Categories two | Alias one, Alias two |
This is a list of devices using this variable. To see installation instructions and code snippet click here
Device token | Device type | Categories | Alias | Reciving |
---|---|---|---|---|
9872626727621679821s878799 | iPhone | Categories one, Categories two | Alias one, Alias two | |
9872626727621679821s878799 | iPhone | Categories one, Categories two | Alias one, Alias two | |
9872626727621679821s878799 | iPhone | Categories one, Categories two | Alias one, Alias two | |
9872626727621679821s878799 | iPhone | Categories one, Categories two | Alias one, Alias two | |
9872626727621679821s878799 | iPhone | Categories one, Categories two | Alias one, Alias two | |
9872626727621679821s878799 | iPhone | Categories one, Categories two | Alias one, Alias two |
This is a list of devices using this variable. To see installation instructions and code snippet click here
Device token | Device type | Categories | Alias | Reciving |
---|---|---|---|---|
9872626727621679821s878799 | iPhone | Categories one, Categories two | Alias one, Alias two | |
9872626727621679821s878799 | iPhone | Categories one, Categories two | Alias one, Alias two | |
9872626727621679821s878799 | iPhone | Categories one, Categories two | Alias one, Alias two | |
9872626727621679821s878799 | iPhone | Categories one, Categories two | Alias one, Alias two | |
9872626727621679821s878799 | iPhone | Categories one, Categories two | Alias one, Alias two | |
9872626727621679821s878799 | iPhone | Categories one, Categories two | Alias one, Alias two |
This is a list of devices using this variable. To see installation instructions and code snippet click here
Device token | Device type | Categories | Alias | Reciving |
---|---|---|---|---|
9872626727621679821s878799 | iPhone | Categories one, Categories two | Alias one, Alias two | |
9872626727621679821s878799 | iPhone | Categories one, Categories two | Alias one, Alias two | |
9872626727621679821s878799 | iPhone | Categories one, Categories two | Alias one, Alias two | |
9872626727621679821s878799 | iPhone | Categories one, Categories two | Alias one, Alias two | |
9872626727621679821s878799 | iPhone | Categories one, Categories two | Alias one, Alias two | |
9872626727621679821s878799 | iPhone | Categories one, Categories two | Alias one, Alias two |