Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

...

...

...

...

...

...

...

...

...

...

...

...

...

Table of Contents

1.Transferring the members logged in Push application directly to the Euromessage member panel

...

Code Block
languagejava
EuroMobileManager.getInstance().setPushPermit(PushPermit.ACTIVE, getApplicationContext());

"extra" : {"email" : "melikeeuromessage@euromsg.yildirim@euromsg.com",
            "keyID" : "677196190708",
            "emailPermit" : "Y"}

2.Android Custom Parameters and Target URL

You can access the variables you defined in the RMC interface from intent.getExtra (). The parameters inside the push notification coming to the Activity, onResume () and onNewIntent ().

Code Block
      if (intent.getExtras() != null) {

        if (EuroMobileManager.getInstance().getNotification(intent) != null) {
            Log.d("Euromessage", EuroMobileManager.getInstance().getNotification(intent).getUrl());
        }

        if (EuroMobileManager.getInstance().getCarousels(intent) != null) {
            Log.d("Euromessage Carousel", EuroMobileManager.getInstance().getCarousels(intent).get(FIRST_ITEM_CAROUSEL).getUrl());
        }

Data Type

Variable

Description

String

mediaUrl

URL for images and video

String

altUrl

Alternate URL

String

campaignId

Campaign ID

String

url

Campaign URL

String

message

Message

String

sound

Sound file

PushType

pushType

Push Type

Map<String, String>

params

Custom parameters

3. Using Android Custom Sound (Using a custom notification sound)
To add Android custom sound, the developer needs to add the relevant custom music to the raw file at the app level.

...

After this step, you should add this value to the Settings / Campaign Settings / Push Applications / Your Android Application / Custom Audio File section of the RMC panel without the file extension of this music.

...

4. Find out which item the user clicked in Carousel Push

You should add receiver to AndroidManifest.xml file as follows.

Code Block
languagexml
<receiver
    android:name="your_broadcast_receiver_here"
    android:exported="false" >
    <intent-filter>
        <action android:name="CarouselItemClickIntentFilter" />
    </intent-filter>
</receiver>

Then you can capture the url of the item clicked inside the receiver as follows.

Code Block
languagejava
package com.relateddigital.euromessage;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.util.Log;
import euromsg.com.euromobileandroid.model.CarouselItem;
import static euromsg.com.euromobileandroid.Constants.CAROUSAL_ITEM_CLICKED_KEY;
import static euromsg.com.euromobileandroid.Constants.CAROUSEL_ITEM_CLICKED_URL;
public class CarouselItemClickReceiver extends BroadcastReceiver {
    private static final String LOG_TAG = "CarouselItemReceiver";
    @Override
    public void onReceive(Context context, Intent intent) {
        if(intent != null) {
            Bundle bundle = intent.getExtras();
            if(bundle != null) {
                CarouselItem itemClicked = (CarouselItem) bundle.getParcelable(CAROUSAL_ITEM_CLICKED_KEY);
                String itemClickedUrl = bundle.getString(CAROUSEL_ITEM_CLICKED_URL);
                if(itemClickedUrl != null && !itemClickedUrl.equals("")) {
                    try {
                        Intent viewIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(itemClickedUrl));
                        viewIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                        context.startActivity(viewIntent);
                    } catch (Exception e) {
                        Log.e(LOG_TAG, "The link is not formatted properly!");
                    }
                }
            }
        }
    }
}

EUROMESSAGE SDK METHODS

1.Subscribe Token  

Method

Explanation

subscibe(String token, Context context)

it sends Token to Euromessage services

 

2.Kullanıcı Özelleştirme ile ilgili Methodlar

Method 

Explanation

setEmail(String email, Context context)

It assigns to E-mail to anonymous user

setEuroUserId(String userKey, Context context)

It assigns to ID to anonymous user

setFacebook(String facebookId, Context context)

It assigns to Facebook id to user

setTwitterId(String twitterId, Context context)

It assigns to Twitter id to user

setPhoneNumber(String msisdn, Context context)

It assigns to phone number to user

setLocation(double latitute, double longitude, Context context)

It assigns to Location to user

setAppVersion(String appVersion)

It assigns to app version to user

setUserProperty(String key, String value, Context context)

It assigns to custom parameter to user (Please contact RMC support team)

  • sync(Context context)

Match token and user

  • It is mandatory to call after making any of the above definitions.

3. SDK Customization Methods

Method

Explanation

reportRead(Bundle bundle)

Informing RMC to push notification read

setChannelName(String channelName, Context context) 

Updates the channel name in the application details

setNotificationColor(String hexColor)

Set Notification Theme color (Hex Color)

setNotificationTransparentSmallIcon(int transparentSmallIcon, Context context)

Set Notification Transparent small icon (Drawable)

setNotificationTransparentSmallIconDarkMode(int transparentSmallIcon, Context context)

It is for setting small icon on notification screen when device is in dark theme. (from Drawable folder)

useNotificationLargeIcon(boolean willBeUsed)

To decide whether to use the big icon on the notification screen.(Default True)

setNotificationLargeIcon(int largeIcon, Context context)

It is for setting the big icon on the notification screen. (from Drawable folder)

setNotificationLargeIconDarkMode(int largeIconDarkMode, Context context)

It is for setting big icon on notification screen when device is in dark theme. (from Drawable folder)

setPushIntent(String intentStr, Context context)

Set the activity to be opened clicking on the notification. The activity package path should set. Optional

setNotificationPriority(RDNotificationPriority priority, Context context)

It is for setting the priority of the notifications. For heads-up notifications, the priority must be set to HIGH.

setPushPermit(PushPermit pushPermit, Context context)

Push permissions on RMC panel are set as Active or Passive

setEmailPermit(EmailPermit emailPermit, Context context)

Push permissions on RMC panel are set as Active or Passive

setGsmPermit(GsmPermit gsmPermit, Context context)

Push permissions on RMC panel are set as Active or Passive

removePushIntent(Context context)

Removes the activity to open clicking on the notification

removeChannelName(Context context)

Removes channel name in application details

removeIntentExtra(Context context)

Removes application extras

removeNotificationColor(Context context)

Removes notification theme color

removeNotificationTransparentSmallIcon(Context context)

Removes the notification icon

removeUserProperties(Context context)

Removes extra parameters

getCarousel(Intent intent)

Gives you the target url for carousel

getNotification(Intent intent)

Gives you the target url for text and image

Sample;

Code Block
languagejava
euroMobileManager = EuroMobileManager.init(Constants.GOOGLE_APP_ALIAS, Constants.HUAWEI_APP_ALIAS, getApplicationContext());

//optional
euroMobileManager.setNotificationTransparentSmallIcon(android.R.drawable.star_off, getApplicationContext());
euroMobileManager.setNotificationTransparentSmallIconDarkMode(R.drawable.delete_icon_dark_mode, getApplicationContext());
euroMobileManager.useNotificationLargeIcon(true);
euroMobileManager.setNotificationLargeIcon(R.drawable.euromessage, getApplicationContext());
euroMobileManager.setNotificationLargeIconDarkMode(R.drawable.related_digital_dark_mode, getApplicationContext());
euroMobileManager.setNotificationColor("#d1dbbd");
euroMobileManager.setChannelName("Demo", getApplicationContext());
euroMobileManager.setPushIntent("com.relateddigital.euromessage.MainActivity", getApplicationContext());


Reflection of Push Campaign Revenues to RMC Panel

...

This method returns the list of anonymous push messages sent in the last 30 days.

...

Code Block
languagejava
PushMessageInterface pushMessageInterface = new PushMessageInterface() {
    @Override
    public void success(List<Message> pushMessages) {
        // Make your implementation by using pushMessages here:
    }

    @Override
    public void fail(String errorMessage) {
        // Something went wrong. You may consider warning the user:
    }
};
EuroMobileManager.getInstance().getPushMessages(your_activity, pushMessageInterface);

If you want to save and get the notifications based on logged-in user, you must set the userID (email, telephone no, etc.) after the user logins in your application by using the method below:

Code Block
languagejava
euroMobileManager.setNotificationLoginID("user_id", context);

After setting the userID like the one above, the notifications will be saved with that user ID. You can get the notifications sent to the user who is logged-in in your application by using the getPushMessagesWithID() method:

Code Block
languagejava
PushMessageInterface pushMessageInterface = new PushMessageInterface() {
    @Override
    public void success(List<Message> pushMessages) {
        // Make your implementation by using pushMessages here:
    }

    @Override
    public void fail(String errorMessage) {
        // Something went wrong. You may consider warning the user:
    }
};
EuroMobileManager.getInstance().getPushMessagesWithID(your_activity, pushMessageInterface);