The plugin written in Android Studio is working fifty fifty, Android Studio PluginClass.java: package androidproject.alientechlab.com.unityplugin; import android.app.AlarmManager; import android.app.PendingIntent; import android.content.Context; import android.content.Intent; import android.os.SystemClock; import android.support.v7.app.AppCompatActivity; import android.widget.Toast; import com.unity3d.player.UnityPlayer; import com.unity3d.player.UnityPlayerActivity; public class PluginClass { private Context context; private static PluginClass instance; public PluginClass() { this.instance = this; } public static PluginClass instance() { if(instance == null) { instance = new PluginClass(); } return instance; } public void setContext() { this.context = UnityPlayer.currentActivity.getApplicationContext(); } public void basla () { Toast.makeText(this.context, "Alarm Başladı", Toast.LENGTH_SHORT).show(); startAlarm(); } private void startAlarm() { AlarmManager manager = (AlarmManager)UnityPlayer.currentActivity.getSystemService(Context.ALARM_SERVICE); Intent myIntent; PendingIntent pendingIntent; myIntent = new Intent (UnityPlayer.currentActivity,AlarmReceiver.class); pendingIntent = PendingIntent.getBroadcast(UnityPlayer.currentActivity,0,myIntent,PendingIntent.FLAG_UPDATE_CURRENT); manager.set(AlarmManager.RTC_WAKEUP, System.currentTimeMillis()+3000,pendingIntent); } public void showMessage(String message) { Toast.makeText(this.context, message, Toast.LENGTH_SHORT).show(); } } Android Studio AlarmReceiver.java: package androidproject.alientechlab.com.unityplugin; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.widget.Toast; import com.unity3d.player.UnityPlayer; /** * Created by Alpaslan on 6.3.2018. */ public class AlarmReceiver extends BroadcastReceiver { [USER=530556]@override[/USER] public void onReceive(Context context, Intent ıntent) { Toast.makeText(context,"Devam ediyoruz...",Toast.LENGTH_SHORT).show(); } } and In Unity Script: using System.Collections; using System.Collections.Generic; using UnityEngine; public class PluginWrapper : MonoBehaviour { private AndroidJavaObject toastExample = null; private AndroidJavaObject activityContext = null; // Use this for initialization void Start () { if(toastExample == null) { using(AndroidJavaClass pluginClass = new AndroidJavaClass("androidproject.alientechlab.com.unityplugin.PluginClass")) { if(pluginClass != null) { toastExample = pluginClass.CallStatic<AndroidJavaObject>("instance"); toastExample.Call("setContext"); toastExample.Call("showMessage", "This is a Toast message"); } } } } public void basla () { using(AndroidJavaClass pluginClass = new AndroidJavaClass("androidproject.alientechlab.com.unityplugin.PluginClass")) { toastExample.Call("basla"); } } } When i try my apk, PluginClass's Toast Messages are showing but Alarm Manager's toast Messages isn't work. Thanks...
https://forum.unity.com/threads/using-code-tags-properly.143875/ Please use code tags. Have you checked the ADB output log?
Logcat basically. But honestly, you should try the Android part of the forums, you might have better luck there. Or if this is a plugin you found somewhere, might see if you can get in touch with the person who wrote it.
I follow my apk on adb and get this message only, there is no error : "Suspiciously short interval 3000 millis; expanding to 60 seconds".