import com.moengage.cards.ui.compose.MoECardComposeActivityimport com.moengage.core.MOENGAGE_ACCOUNT_IDENTIFIERval intent = Intent(this, MoECardComposeActivity::class.java)// Pass the extra only if your application is configured with more than one workspace.intent.putExtra(MOENGAGE_ACCOUNT_IDENTIFIER, "YOUR_WORKSPACE_ID")startActivity(intent)
<resources> <!-- Toolbar title in MoECardComposeActivity, and the activity label. Default: Inbox --> <string name="moe_card_feed_title">Notifications</string> <!-- Button shown when new cards arrive while the feed is open. Default: New Updates --> <string name="moe_card_new_updates">New messages</string> <!-- Empty state. Default: No notifications to show, check again later. --> <string name="moe_card_no_message_available">You are all caught up.</string> <!-- Delete option on long press. Default: Delete --> <string name="moe_card_delete_title">Remove</string></resources>
import com.moengage.cards.ui.compose.MoECardsComposeUiHelperMoECardsComposeUiHelper.setClickListener({ clickData -> // clickData.card holds the card that was tapped. // clickData.navigationAction holds the configured action. false}, "YOUR_WORKSPACE_ID")
SDK には、ユーザーがまだクリックしていないカードの数を取得する API が用意されています。件数を取得するには、以下の API を使用してください。
import com.moengage.cards.core.MoECardHelper// Call this API on worker thread as it reads from a file.MoECardHelper.getUnClickedCardCount(context)// This API returns the count asynchronously in the listener passed as a parameter.MoECardHelper.getUnClickedCardCountAsync(context, listener)
import com.moengage.cards.core.MoECardHelper;// Call this API on worker thread as it reads from a file.MoECardHelper.INSTANCE.getUnClickedCardCount(context);// This API returns the count asynchronously in the listener passed as a parameter.MoECardHelper.INSTANCE.getUnClickedCardCountAsync(context, listener);
SDK には、デバイス上のユーザーの新着カードを取得する API が用意されています。件数を取得するには、以下の API を使用してください。
import com.moengage.cards.core.MoECardHelper// Call this API on worker thread as it reads from a file.MoECardHelper.getNewCardCount(context)// This API returns the count asynchronously in the listener passed as a parameter.MoECardHelper.getNewCardCountAsync(context, listener)
import com.moengage.cards.core.MoECardHelper;// Call this API on worker thread as it reads from a file.MoECardHelper.INSTANCE.getNewCardCount(context);// This API returns the count asynchronously in the listener passed as a parameter.MoECardHelper.INSTANCE.getNewCardCountAsync(context, listener);