Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Table of Contents

Modülün Etkinleştirilmesi

Burada açıklandığı gibi etkinleştirilmelidir.

Uygulama-İçi Mesajlar

...

Enabling The Module

You can enable it as described here.

In-App Messages

In order to show your user an in-app message, you need to create a targeting action on RMC panel and fill the related field first. Then, you can trigger the targeting action you created as show below and show the user it via your mobile application.

Kotlin

Code Block
languagekotlin
val parameters = HashMap<String, String>()
RelatedDigital.customEvent(
  context = context,
  pageName = "UygulamaIn-İçiApp MesajMessage",
  properties = parameters,
  parent = activity
)

Java

Code Block
languagejava
HashMap<String, String> parameters = new HashMap<String, String>();
RelatedDigital.customEvent(
  context,
  "UygulamaIn-İçiApp MesajMessage",
  parameters,
  activity
);

Uygulama-içi mesaj göstermek için yukarıdaki gibi customEvent metodunu çağırırken parent parametresi null olmamalıdır. parent parametresine bir Activity değeri verilmezse mesaj görünmeyecektir.

Info
Info

Eğer RMC panelde oluşturduğunuz forma bir kural tanımladıysanız bu kuralın da customEvent metodu içerisindeki properties parametresi aracılığıyla girilmesi gerekmektedir. Örnek:The parent parameters above cannot be null. If you do not enter an Activity value for parent parameters, the message is not going to be shown.

Info

If you use a rule in your targeting action on RMC, you should enter it via properties map. Example,

parameters["OM.inapptype"] = "full_screen_image"

parameters.put("OM.inapptype", "full_screen_image");

Tıklanmanın Yakalanması

...

Click Action Callback

When the user click on the item that includes a link to navigate to another page, you can define what is going to happen next by setting a callback method. You should set this callback via RelatedDigital.setInAppButtonInterface() method.

Kotlin

Code Block
languagekotlin
val buttonCallback: InAppButtonInterface = object : InAppButtonInterface {
  override fun onPress(link: String?) {
    //Tıklama sonrası çalıştırılacak kodu buraya yazınız.Write the code that is going to be executed after the click
  }
}
RelatedDigital.setInAppButtonInterface(buttonCallback)

val parameters = HashMap<String, String>()
RelatedDigital.customEvent(
  context = context,
  pageName = "UygulamaIn-İçiApp MesajMessage",
  properties = parameters,
  parent = activity
)

Java

Code Block
languagejava
InAppButtonInterface buttonCallback = new InAppButtonInterface() {
  @Override
  public void onPress(String link) {
    //Tıklama sonrası çalıştırılacak kodu buraya yazınız. Write the code that is going to be executed after the click   
  }
};

RelatedDigital.setInAppButtonInterface(buttonCallback);

HashMap<String, String> parameters = new HashMap<String, String>();
RelatedDigital.customEvent(
  context,
  "UygulamaIn-İçiApp MesajMessage",
  parameters,
  activity
);

Her tıklama sonrası, SDK girilen callback i çağırır ve tanımlanan callback i kaldırır. Bu yüzden callback kullanmak isteğiniz her aksiyondan önce yeni bir callback tanımlaması yapıp setInAppButtonInterface metodu aracılığıyla SDK ya iletmeniz gerekmektedir. Daha sonra customEvent metoduyla ilgili aksiyonu tetikleyebilirsiniz.

Info

Özel Font Kullanımı

  1. Uygulama-içi mesajlarda özel font kullanımı için ilk olarak projenizin res klasörü altında font dosyası oluşturunuz(yoksa).

    Image Removed

     

  2. Oluşturduğunuz klasörün içerisine istediğiniz fontları ekleyebilirsiniz.

    Image Removed

     

  3. Son olarak arayüzden uzantısız bir şekilde kullanmak istediğiniz fontun adını giriniz.

    Image Removed

...

Pop-up - Görsel, Başlık, Yazı & Buton

...

Mini - İkon & Yazı

...

After each click, the SDK calls the callback that was entered and removes it. Thus, you should set the callback via setInAppButtonInterface for each targeting action that you want to use a callback for click action. Then, you can call customEvent() method.

Custom Font Usage

  1. First of all, you need to create a font folder (unless you have one) under res folder in your project.

    Image Added

     

  2. You can add your font files into the folder (font) you created.

    Image Added

     

  3. Lastly, you should enter the name of the font without extension in the user interface.

    Image Added


In-App Message Templates

Pop-up - Image, Title, Text & Button

Mini - Icon & Text

Full Screen Image

 

 Tam Ekran Görsel ve Buton

Full Screen Image & Button

Pop-up - GörselImage, Başlık, Yazı ve ButonTitle, Text and Button

Pop-up AnketSurvey

 

 

 

Pop-up - Yazı ve Butonlu Text and Button NPS

Native Alert & Action Sheet

1-10 Puanlama Point NPS

 

 

Yıldızlı anket & ikinci Survey with Star & Second pop-up

Yarım Ekran GörselHalf Screen Image

Carousel

 

 

 

 

Favori

...

Attributes Action

You can use the favorite attributes that you define on RMC->targeting actions in your application as show below.

Kotlin

Code Block
languagekotlin
val callback: VisilabsCallback = object : VisilabsCallback {
  override fun success(response: VisilabsResponse?) {
    try {
      val favsResponse: FavsResponse = Gson().fromJson(response!!.rawResponse, FavsResponse::class.java)
      val favBrands: String = favsResponse.favoriteAttributeAction!![0].actiondata!!.favorites!!.brand!![0]!!
      Log.i("Favs 1.Brand", favBrands)
    } catch (e: Exception) {
      Log.e("FavoriFavorite ÖzellikAttribute", e.message)
    }
  }

  override fun fail(response: VisilabsResponse?) {
    Log.e("FavoriFavorite ÖzellikAttribute", response!!.error!!.message)
  }
}

RelatedDigital.getFavorites(
  context = context,
  actionId = null,
  actionType = Constants.FavoriteAttributeAction,
  visilabsCallback = callback)

Java

Code Block
languagejava
VisilabsCallback callback = new VisilabsCallback() {
  @Override
  public void success(VisilabsResponse response) {
    try {
      FavsResponse favsResponse = new Gson().fromJson(response.getRawResponse(), FavsResponse.class);
      String favBrands = favsResponse.getFavoriteAttributeAction().get(0).getActiondata().getFavorites().getBrand()[0];
      Log.i("Favs 1.Brand", favBrands); 
    } catch(Exception e) {
      Log.e("FavoriFavorite ÖzellikAttribute", e.getMessage());
    }     
  }

  @Override
  public void fail(VisilabsResponse response) {
    Log.e("FavoriFavorite ÖzellikAttribute", response.getError().getMessage);
  }
};

RelatedDigital.getFavorites(
  context,
  null,
  Constants.FavoriteAttributeAction,
  callback);

Story Manager

Uygulamanızın layout unda dilediğiniz bir alana StoryRecyclerView ı yerleştirinizPlease, put StoryRecyclerView into wherever you want in your layout.

Code Block
languagexml
<com.relateddigital.relateddigital_android.inapp.story.StoryRecyclerView
  android:id="@+id/story_recycler_view"
  android:layout_width="match_parent"
  android:layout_height="wrap_content" />

StoryItemClickListener tanımlayarak her bir story’e tıklandığında yapmak istediğiniz yönlendirme veya alınacak aksiyonu tanımlayınız.

Ardından StoryRecyclerView ın setStoryAction veya setStoryActionId methodunu çağırarak storyItemClickListenerobjesini methoda ekleyinizPlase, define a StoryItemClickListener and determine what action is going to be taken after a story is clicked.

Then, you should call setStoryAction or setStoryActionId methods with then StoryItemClickListener object you defined.

Kotlin

Code Block
languagekotlin
val storyItemClickListener = object : StoryItemClickListener {
  override fun storyItemClicked(storyLink: String?) {
    //BuradaTake the storyLinkaction değişkeninihere kullanarakby gerekliusing yönlendirmeyistoryLink yapabilirsinizvariable
  }
}     
binding.storyRecyclerView.setStoryAction(
  context = context,
  storyItemClickListener = storyItemClickListener)

Java

Code Block
languagejava
StoryItemClickListener storyItemClickListener = new StoryItemClickListener() {
  @Override
  public void storyItemClicked(String storyLink) {
    //BuradaTake the storyLinkaction değişkeninihere kullanarakby gerekliusing yönlendirmeyistoryLink yapabilirsinizvariable         
  }
};   
binding.storyRecyclerView.setStoryAction(
  context,
  storyItemClickListener);

veya

Kotlin

Code Block
languagekotlin
val storyItemClickListener = object : StoryItemClickListener {
  override fun storyItemClicked(storyLink: String?) {
    //BuradaTake the storyLinkaction değişkeninihere kullanarakby gerekliusing yönlendirmeyistoryLink yapabilirsinizvariable
  }
}     
binding.storyRecyclerView.setStoryActionId(
  context = context,
  storyId = storyId,
  storyItemClickListener = storyItemClickListener)

Java

Code Block
languagejava
StoryItemClickListener storyItemClickListener = new StoryItemClickListener() {
  @Override
  public void storyItemClicked(String storyLink) {
    //BuradaTake the storyLinkaction değişkeninihere kullanarakby gerekliusing yönlendirmeyistoryLink yapabilirsinizvariable         
  }
};     
binding.storyRecyclerView.setStoryActionId(
  context,
  storyId,
  storyItemClickListener);

...

,
  storyItemClickListener);

You can use setStoryActionWithRequestCallback or setStoryActionIdWithRequestCallback methods instead if you want to enter a StoryRequestListener object. This parameter is for you to take a precaution in case of something goes wrong and the request fails. In this case, you should make the visibility of StoryRecyclerView View.GONE so that there will not be an empty area in your layout.

Kotlin

Code Block
languagekotlin
val storyItemClickListener = object : StoryItemClickListener {
  override fun storyItemClicked(storyLink: String?) {
    //Take the action here by //Buradausing storyLink değişkeninivariable kullanarak gerekli yönlendirmeyi yapabilirsiniz
  }
}
val storyRequestListener = object : StoryRequestListener {
  override fun onRequestResult(isAvailable: Boolean) {
    if (!isAvailable) {
      //BuradaMake the StoryRecyclerView ı kaldırmalısınız's visibility View.GONE here
      binding.storyRecyclerView.visibility = View.GONE
    }
  }
}    
binding.storyRecyclerView.setStoryActionWithRequestCallback(
  context = context,
  storyItemClickListener = storyItemClickListener,
  storyRequestListener = storyRequestListener)

Java

Code Block
languagejava
StoryItemClickListener storyItemClickListener = new StoryItemClickListener() {
  @Override
  public void storyItemClicked(String storyLink) {
    //BuradaTake the action here by using storyLink değişkeninivariable kullanarak gerekli yönlendirmeyi yapabilirsiniz         
  }
}; 

StoryRequestListener storyRequestListener = new StoryRequestListener() {
  @Override
  public void onRequestResult(boolean isAvailable) {
    if (!isAvailable) {
      //BuradaMake the StoryRecyclerView ı kaldırmalısınız's visibility View.GONE here
      binding.storyRecyclerView.visibility = View.GONE
    }         
  }
};
   
binding.storyRecyclerView.setStoryActionWithRequestCallback(
  context,
  storyItemClickListener,
  storyRequestListener);

setStoryActionIdWithRequestCallback

Kotlin

Code Block
languagekotlin
val storyItemClickListener = object : StoryItemClickListener {
  override fun storyItemClicked(storyLink: String?) {
    //Take the action here by //Buradausing storyLink değişkeninivariable kullanarak gerekli yönlendirmeyi yapabilirsiniz
  }
}
val storyRequestListener = object : StoryRequestListener {
  override fun onRequestResult(isAvailable: Boolean) {
    if (!isAvailable) {
      //BuradaMake the StoryRecyclerView ı kaldırmalısınız's visibility View.GONE here
      binding.storyRecyclerView.visibility = View.GONE
    }
  }
}    
binding.storyRecyclerView.setStoryActionIdWithRequestCallback(
  context = context,
  storyId = storyId,
  storyItemClickListener = storyItemClickListener,
  storyRequestListener = storyRequestListener)

Java

Code Block
languagejava
StoryItemClickListener storyItemClickListener = new StoryItemClickListener() {
  @Override
  public void storyItemClicked(String storyLink) {
    //BuradaTake the action here by using storyLink değişkeninivariable kullanarak gerekli yönlendirmeyi yapabilirsiniz        
   }
}; 

StoryRequestListener storyRequestListener = new StoryRequestListener() {
  @Override
  public void onRequestResult(boolean isAvailable) {
    if (!isAvailable) {
      //BuradaMake the StoryRecyclerView ı kaldırmalısınız's visibility View.GONE here
      binding.storyRecyclerView.visibility = View.GONE
    }         
  }
};
   
binding.storyRecyclerView.setStoryActionIdWithRequestCallback(
  context,
  storyId,
  storyItemClickListener,
  storyRequestListener);

Öneriler Aksiyonu

...

Recommendations Action

You can trigger recommendations action in your application as shown below:

Kotlin

Code Block
languagekotlin
val callback: VisilabsCallback = object : VisilabsCallback {
  override fun success(response: VisilabsResponse?) {
    try {
      //You can take Buradathe gelenaction önerilerhere listesiylewith ilgilithe aksiyonurecommendations' alabilirsiniz.Örnek:response. Example,
      val jsonObject = response!!.json
      val groupTitle = jsonObject!!.getString("title")
      val jsonArray = jsonObject.getJSONArray("recommendations")
      for (i in 0 until jsonArray.length()) {
        val currentProductObject = jsonArray.getJSONObject(i)
        val currentProductTitle = currentProductObject.getString("title")
        val currentProductPrice = currentProductObject.getDouble("price")
        val currentProductFreeShipping = currentProductObject.getBoolean("freeshipping")
        val qs = currentProductObject.getString("qs")
        //BuContinues şekildelike devam ederthis...
      }
    } catch (e: Exception) {
      Log.e("ÖnerilerRecommendations", e.message)
    }
  }

  override fun fail(response: VisilabsResponse?) {
    Log.e("ÖnerilerRecommendations", response!!.error!!.message)
  }
}

RelatedDigital.getRecommendations(
  context = context,
  zoneId = "zoneIdDeğerizoneIdValue",
  productCode = "ÜrünKoduDeğeriproductCodeValue",
  visilabsCallback = callback)

Java

Code Block
languagejava
VisilabsCallback callback = new VisilabsCallback() {
  @Override
  public void success(VisilabsResponse response) {
    try {
      // Burada gelen öneriler listesiyle ilgili aksiyonu alabilirsiniz.Örnek:You can take the action here with the recommendations' response. Example,
      JSONObject jsonObject = response.getJson();
      String groupTitle = jsonObject.getString("title");
      JSONArray jsonArray = jsonObject.getJSONArray("recommendations");
      for (int i = 0; i < jsonArray.length(); i++) {
         JSONObject currentProductObject = jsonArray.getJSONObject(i);
         String currentProductTitle = currentProductObject.getString("title");
         Double currentProductPrice = currentProductObject.getDouble("price");
         Boolean currentProductFreeShipping = currentProductObject.getBoolean("freeshipping");
         String qs = currentProductObject.getString("qs");
         //BuContinues şekildelike devam ederthis...
      }
    } catch(Exception e) {
      Log.e("ÖnerilerRecommendations", e.getMessage());
    }    
  }

  @Override
  public void fail(VisilabsResponse response) {
    Log.e("ÖnerilerRecommendations", response.getError().getMessage());
  }
};

RelatedDigital.getRecommendations(
  context,
  "zoneIdDeğerizoneIdValue",
  "ÜrünKoduDeğeriproductCodeValue",
  callback);

Ayrıca, filtreleri ve ek parametreleri de getRecommendations metodu aracılığıyla kullanabilirsinizAlso, you can input some filters and extra parameters to getRecommendations method.

Kotlin

Code Block
languagekotlin
val callback: VisilabsCallback = object : VisilabsCallback {
  override fun success(response: VisilabsResponse?) {
    try {
      //You Burada gelen öneriler listesiyle ilgili aksiyonu alabilirsiniz.Örnek:can take the action here with the recommendations' response. Example,
      val jsonObject = response!!.json
      val groupTitle = jsonObject!!.getString("title")
      val jsonArray = jsonObject.getJSONArray("recommendations")
      for (i in 0 until jsonArray.length()) {
        val currentProductObject = jsonArray.getJSONObject(i)
        val currentProductTitle = currentProductObject.getString("title")
        val currentProductPrice = currentProductObject.getDouble("price")
        val currentProductFreeShipping = currentProductObject.getBoolean("freeshipping")
        val qs = currentProductObject.getString("qs")
        //BuContinues şekildelike devam ederthis...
      }
    } catch (e: Exception) {
      Log.e("ÖnerilerRecommendations", e.message)
    }
  }

  override fun fail(response: VisilabsResponse?) {
    Log.e("ÖnerilerRecommendations", response!!.error!!.message)
  }
}

val filters = ArrayList<VisilabsTargetFilter>()
val parameters = HashMap<String, String>()
parameters["OM.extra"] = "Extra Value"
val f1 = VisilabsTargetFilter("attr1", "0", "value1")
filters.add(f1)
val f2 = VisilabsTargetFilter("attr2", "1", "value2")
filters.add(f2)

RelatedDigital.getRecommendations(
  context = context,
  zoneId = "zoneIdDeğerizoneIdValue",
  productCode = "ÜrünKoduDeğeriproductCodeValue",
  visilabsCallback = callback,
  properties = parameters,
  filters = filters)

Java

Code Block
languagejava
VisilabsCallback callback = new VisilabsCallback() {
  @Override
  public void success(VisilabsResponse response) {
    try {
      //You can take Buradathe gelenaction önerilerhere listesiylewith ilgilithe aksiyonurecommendations' alabilirsiniz.Örnek:response. Example,
      JSONObject jsonObject = response.getJson();
      String groupTitle = jsonObject.getString("title");
      JSONArray jsonArray = jsonObject.getJSONArray("recommendations");
      for (int i = 0; i < jsonArray.length(); i++) {
         JSONObject currentProductObject = jsonArray.getJSONObject(i);
         String currentProductTitle = currentProductObject.getString("title");
         Double currentProductPrice = currentProductObject.getDouble("price");
         Boolean currentProductFreeShipping = currentProductObject.getBoolean("freeshipping");
         String qs = currentProductObject.getString("qs");
         //BuContinues şekildelike devam ederthis...
      }
    } catch(Exception e) {
      Log.e("ÖnerilerRecommendations", e.getMessage());
    }    
  }

  @Override
  public void fail(VisilabsResponse response) {
    Log.e("ÖnerilerRecommendations", response.getError().getMessage());
  }
};

ArrayList<VisilabsTargetFilter> filters = new ArrayList<VisilabsTargetFilter>();
HashMap<String, String> parameters = new HashMap<String, String>();
parameters.put("OM.extra", "Extra Value");
VisilabsTargetFilter f1 = new VisilabsTargetFilter("attr1", "0", "value1");
filters.add(f1);
VisilabsTargetFilter f2 = new VisilabsTargetFilter("attr2", "1", "value2");
filters.add(f2);

RelatedDigital.getRecommendations(
  context,
  "zoneIdDeğerizoneIdValue",
  "ÜrünKoduDeğeriproductCodeValue",
  callback,
  parameters,
  filters = filters);

...

In order the clicks of the recommendations to be reflected on the panel, you should send the “qs” value of the recommendation that is clicked by the user to the server via trackRecommendationClick method.

Info

You can see how to get “qs” value for each recommendation in the example callback method above.

Kotlin

Code Block
languagekotlin
RelatedDigital.trackRecommendationClick(
  context = context,
  qs = qs)

Java

Code Block
languagejava
RelatedDigital.trackRecommendationClick(
  context,
  qs);

Mail

...

Subscription Form

You can trigger the mail subscription form that you defined on RMC panel as shown below:

Kotlin

Code Block
languagekotlin
val parameters = HashMap<String, String>()
RelatedDigital.customEvent(
  context = context,
  pageName = "Mail ÜyelikSubscription",
  properties = parameters,
  parent = activity
)

Java

Code Block
languagejava
HashMap<String, String> parameters = new HashMap<String, String>();
RelatedDigital.customEvent(
  context,
  "Mail ÜyelikSubscription",
  parameters,
  activity
);

...

Info

parent parametresi ile ilgili Activity değerini geçtiğinizden emin olunuz.

RMC panelden oluşturduğunuz aksiyonda bir kural tanımladıysanız bu kuralı da parameters ile geçmeniz gerekmektedir. Örnek:Please make sure that you input an Activity with the parameter of parent.

If you define a rule for your targeting action on RMC panel, please make sure that you add this rule to the map before calling customEvent() method. Example,

parameters["type"] = "mail_subs_form"

parameters.put("type", "mail_subs_form");

Çarkıfelek

...

SpinToWin

You can trigger the spin-to-win action that you defined on RMC panel as shown below:

Kotlin

Code Block
languagekotlin
val parameters = HashMap<String, String>()
RelatedDigital.customEvent(
  context = context,
  pageName = "ÇarkıfelekSpinToWin",
  properties = parameters,
  parent = activity
)

Java

Code Block
languagejava
HashMap<String, String> parameters = new HashMap<String, String>();
RelatedDigital.customEvent(
  context,
  "ÇarkıfelekSpinToWin",
  parameters,
  activity
);

Çarkıfelek Yarım Görünüm

Çarkıfelek Tam Görünüm

 

 

...

parent parametresi ile ilgili Activity değerini geçtiğinizden emin olunuz.

...

Info

Please make sure that you input an Activity with the parameter of parent.

If you define a rule for your targeting action on RMC panel, please make sure that you add this rule to the map before calling customEvent() method. Example,

parameters["type"] = "spin_to_win"

parameters.put("type", "spin_to_win");

Kazı Kazan

...

;

ScratchToWin

You can trigger the scratch-to-win action that you defined on RMC panel as shown below:

Kotlin

Code Block
languagekotlin
val parameters = HashMap<String, String>()
RelatedDigital.customEvent(
  context = context,
  pageName = "Kazı KazanScratchToWin",
  properties = parameters,
  parent = activity
)

Java

Code Block
languagejava
HashMap<String, String> parameters = new HashMap<String, String>();
RelatedDigital.customEvent(
  context,
  "Kazı KazanScratchToWin",
  parameters,
  activity
);

...

Info

parent parametresi ile ilgili Activity değerini geçtiğinizden emin olunuz.

RMC panelden oluşturduğunuz aksiyonda bir kural tanımladıysanız bu kuralı da parameters ile geçmeniz gerekmektedir. Örnek:Please make sure that you input an Activity with the parameter of parent.

If you define a rule for your targeting action on RMC panel, please make sure that you add this rule to the map before calling customEvent() method. Example,

parameters["type"] = "scratch_to_win"

parameters.put("type", "scratch_to_win");

Ürün Durum Bilgisi

...

Product Stat Notifier

You can trigger the product stat notifier action that you defined on RMC panel as shown below:

Kotlin

Code Block
languagekotlin
val parameters = HashMap<String, String>()
RelatedDigital.customEvent(
  context = context,
  pageName = "ÜrünProduct DurumStat BilgisiNotifier",
  properties = parameters,
  parent = activity
)

Java

Code Block
languagejava
HashMap<String, String> parameters = new HashMap<String, String>();
RelatedDigital.customEvent(
  context,
  "ÜrünProduct DurumStat BilgisiNotifier",
  parameters,
  activity
);

...

Info

parent parametresi ile ilgili Activity değerini geçtiğinizden emin olunuz.

RMC panelden oluşturduğunuz aksiyonda bir kural tanımladıysanız bu kuralı da parameters ile geçmeniz gerekmektedir. Örnek:Please make sure that you input an Activity with the parameter of parent.

If you define a rule for your targeting action on RMC panel, please make sure that you add this rule to the map before calling customEvent() method. Example,

parameters["type"] = "product_stat_notifier"

parameters.put("type", "product_stat_notifier");

...