-
-
Save secondsun/242063868b09db030331 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_main); | |
try { | |
Registrar r = new Registrar(new URL("http://192.168.1.194:8080/ag-push/rest/registry/device")); | |
PushConfig config = new PushConfig("272275396485"); | |
config.setMobileVariantId("342ff906-3772-415c-ad39-b25faa18d332"); | |
config.setAlias("someGuy"); | |
r.register(getApplicationContext(), config, new Callback<Void>() { | |
private static final long serialVersionUID = 1L; | |
@Override | |
public void onSuccess(Void arg0) { | |
Toast.makeText(getApplicationContext(), "Success", Toast.LENGTH_LONG).show(); | |
} | |
@Override | |
public void onFailure(Exception arg0) { | |
Log.e("ERROR", arg0.getMessage(), arg0); | |
Toast.makeText(getApplicationContext(), "Failure", Toast.LENGTH_LONG).show(); | |
} | |
}); | |
} catch (MalformedURLException e) { | |
throw new RuntimeException(e); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment