|
|
@@ -1,4 +1,5 @@
|
|
|
package com.hola;
|
|
|
+import android.content.Intent;
|
|
|
import android.graphics.Color;
|
|
|
|
|
|
import expo.modules.ReactActivityDelegateWrapper;
|
|
|
@@ -28,7 +29,7 @@ public class MainActivity extends ReactActivity {
|
|
|
return new ReactActivityDelegateWrapper(this, new MainActivityDelegate(this, getMainComponentName()));
|
|
|
}
|
|
|
|
|
|
- public static class MainActivityDelegate extends ReactActivityDelegate {
|
|
|
+ public class MainActivityDelegate extends ReactActivityDelegate {
|
|
|
public MainActivityDelegate(ReactActivity activity, String mainComponentName) {
|
|
|
super(activity, mainComponentName);
|
|
|
}
|
|
|
@@ -39,6 +40,13 @@ public class MainActivity extends ReactActivity {
|
|
|
reactRootView.setBackgroundColor(Color.rgb(0,0,0));
|
|
|
// If you opted-in for the New Architecture, we enable the Fabric Renderer.
|
|
|
reactRootView.setIsFabric(BuildConfig.IS_NEW_ARCHITECTURE_ENABLED);
|
|
|
+
|
|
|
+ Intent intent = new Intent(getContext(), AlarmService.class);
|
|
|
+ intent.putExtra("title", "My Notification");
|
|
|
+ intent.putExtra("message", "This is a scheduled local notification.");
|
|
|
+ intent.putExtra("triggerTime", System.currentTimeMillis() + 10000); // 60秒后触发
|
|
|
+ startService(intent);
|
|
|
+
|
|
|
return reactRootView;
|
|
|
}
|
|
|
|