" Clover emits broadcasts when important events occur, such as when a new order or payment is created. Your application can register a broadcast receiver in order to listen and respond to these events.
Example
Setting a listener for the ACTION_ORDER_CREATED intent will trigger your app whenever an order is created. Your app will receive the ID for the new order."
Example
Setting a listener for the ACTION_ORDER_CREATED intent will trigger your app whenever an order is created. Your app will receive the ID for the new order."
As of now, it doesn't launch, and I am not able to see any evidence that the broadcast receiver is receiving anything. Below is my Receiver code and my AndroidManifest.xml. Any advice is appreciated!
TransactionReceiver.java
public class TransactionReceiver extends BroadcastReceiver {AndroidManifest.xml
@Override public void onReceive(Context context, Intent intent) {
String action = intent.getAction(); if (action.equals(Intents.ACTION_ORDER_CREATED)) {
Log.d(Constants.TRANSACTION_RECEIVER_TAG,"---ACTION ORDER CREATED---");
String orderId = intent.getStringExtra(EXTRA_CLOVER_ORDER_ID);
Intent mainIntent = new Intent(context, MainActivity.class);
mainIntent.putExtra("ORDER_ID", orderId);
context.startActivity(mainIntent);
}
}
}
<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.bboggs.zipsclover"/>
<uses-permission android:name="android.permission.INTERNET"/>
<application
android:allowBackup="true"android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme"
tools:ignore="GoogleAppIndexingWarning">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" /> </intent-filter>
</activity>
<receiver
android:name=".TransactionReceiver"
android:enabled="true"
android:exported="true" >
<intent-filter>
<action android:name="com.clover.intent.action.ORDER_CREATED" />
</intent-filter>
</receiver>
</application>
</manifest>