Skill Level: Intermediate


An app with the Xamarin SDK (or earlier) installed.


  1. The Xamarin Action subsystem has changed

    With the release, the Action subsystem has changed. The new subsystem is much more flexible, but will require that you modify your existing code. This tutorial explains how to do it.

  2. Add OnStop and OnStart to MainActivity.cs on Android

    Add the following to the MainActivity.cs class in the Android subproject:

    protected override void OnStop()
    protected override void OnStart() 
  3. Remove old plugin files

    Do not use mce/plugins/*json files anymore.

  4. Update OnCreate in MainActivity.cs

    In MainActivity.cs’s OnCreate method, remove:

    var jsonActionString = this.Intent.GetStringExtra("action");
    if (jsonActionString != null)
    	var jsonAction = JObject.Parse(jsonActionString);
    	JObject jsonPayload = null;
    	if (this.Intent.HasExtra("payload"))
    		jsonPayload = JObject.Parse(this.Intent.GetStringExtra("payload"));
    	var attribution = this.Intent.GetStringExtra("attribution");
    	int id=0;
    		id = Int32.Parse(this.Intent.GetStringExtra("id"));
    	catch { }
    	var mailingId = this.Intent.GetStringExtra("mailingId");
    	LoadApplication(new App(jsonAction, jsonPayload, attribution, mailingId, id));
    	LoadApplication(new App());

    and replace it with:

    LoadApplication(new App());
  5. Update the Application’s main class

    Remove this from Application’s main Class:

    public App (JObject jsonAction = null, JObject jsonPayload = null, String attribution = null, String mailingId = null, int id = 0)

    and replace it with

    public App()

    Next, remove this from the main class:

    if (jsonAction != null)
        SDK.Instance.ExecuteAction(jsonAction, jsonPayload, attribution, mailingId, id);

Expected outcome

An app with the Xamarin SDK installed.

Join The Discussion

Your email address will not be published. Required fields are marked *