Leon 1 рік тому
батько
коміт
24f5008eaf

+ 4 - 2
android/app/src/main/java/com/hola/AlarmReceiver.java

@@ -84,13 +84,15 @@ public class AlarmReceiver extends BroadcastReceiver {
 
         notificationManager.notify(msg_id, builder.build());
 
-        repeatNotify(context);
+//        repeatNotify(context,categoryId);
     }
 
-    public static void repeatNotify(Context context){
+    public static void repeatNotify(Context context,String categoryId){
+
         Intent intent = new Intent(context, AlarmReceiver.class);
         intent.putExtra("title", "title");
         intent.putExtra("message", "body");
+        intent.putExtra("categoryId",categoryId);
         PendingIntent pendingIntent = PendingIntent.getBroadcast(
                 context, 0, intent, android.app.PendingIntent.FLAG_UPDATE_CURRENT);
 

+ 6 - 0
android/app/src/main/java/com/hola/MainActivity.java

@@ -100,11 +100,13 @@ public class MainActivity extends ReactActivity {
     if (hasGPS) {
       locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 5000, 0f,
               gpsListener);
+      Log.i("LLLLLLLLLLLLLLocation","GPS enable");
     }
 
     if (hasNetwork){
       locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 5000, 0f,
               networkListener);
+      Log.i("LLLLLLLLLLLLLLocation","Network enable");
     }
 
 //    if (gpsLocation!=null && networkLocation!=null){
@@ -140,6 +142,8 @@ public class MainActivity extends ReactActivity {
       // TODO Auto-generated method stub
       // 更新当前经纬度
       gpsLocation = arg0;
+      Log.i("LLLLLLLLLLLLLLocation","GPS");
+      Toast.makeText(getApplicationContext(),"gps location",Toast.LENGTH_LONG).show();
     }
   };
 
@@ -168,6 +172,8 @@ public class MainActivity extends ReactActivity {
       // TODO Auto-generated method stub
       // 更新当前经纬度
       networkLocation = arg0;
+      Log.i("LLLLLLLLLLLLLLocation","Network");
+      Toast.makeText(getApplicationContext(),"network location",Toast.LENGTH_LONG).show();
     }
   };