Guides
Log In
Guides

Registration & Deregistration Integration Point

Overview


To send a request for registration / deregistration, a broadcast should be used as follows:


Intent intent = Intent(ACTION_REGISTER);
intent.setPackage(PACKAGE_NAME_MONERIS);
intent.putExtra(EXTRA_JSON_REQUEST, request);
sendBroadcast(intent);

The request string that does EXTRA_JSON_REQUEST should follow the JSON format (Registration / Deregistration).

When you want to receive a response on this request, create a BroadcastReceiver with the intent filter as below:


<intent-filter>
    <action android:name="com.moneris.hooks.RegistrationResponse" />
</intent-filter>

The response will be a string in JSON format, and will be included in the extra string key under EXTRA_JSON_RESPONSE:


...
@Override
public void onReceive(Context context, Intent intent) {
    String action = intent.getAction();
    if (action.equals("com.moneris.hooks.RegistrationResponse")) {
       String response = intent.getStringExtra(EXTRA_JSON_RESPONSE);
    }
}
...