Myket In-App Updates
Starting with Myket version 9.8.9, you can use an intent to check whether a newer version of your app is available on Myket. If one is available, Myket displays an update dialog where the user can download and install it.
Launch the intent
Replace APP_PACKAGE_NAME with your app's package name:
myket://check-update?id=APP_PACKAGE_NAME
Behavior
- If a newer version is available on Myket, the user sees Myket's update dialog.
- If the latest version is already installed, no dialog is shown.
Example
- Java
- Kotlin
- Unity
String url = "myket://check-update?id=ir.mservices.mybook";
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
startActivity(intent);
val url = "myket://check-update?id=ir.mservices.mybook"
val intent = Intent(Intent.ACTION_VIEW, Uri.parse(url))
startActivity(intent)
using UnityEngine;
public class MyketIntentExample : MonoBehaviour
{
public void CheckForUpdate()
{
#if UNITY_ANDROID && !UNITY_EDITOR
OpenMyketIntent("myket://check-update?id=ir.mservices.mybook");
#endif
}
private static void OpenMyketIntent(string url)
{
using (var intentClass = new AndroidJavaClass("android.content.Intent"))
using (var uriClass = new AndroidJavaClass("android.net.Uri"))
using (var uri = uriClass.CallStatic<AndroidJavaObject>("parse", url))
using (var intent = new AndroidJavaObject(
"android.content.Intent",
intentClass.GetStatic<string>("ACTION_VIEW"),
uri))
using (var unityPlayer = new AndroidJavaClass("com.unity3d.player.UnityPlayer"))
using (var activity = unityPlayer.GetStatic<AndroidJavaObject>("currentActivity"))
{
activity.Call("startActivity", intent);
}
}
}
The Myket client must be installed on the user's device for this intent to work.