radarlabs / react-native-radar

React Native module for Radar, the leading geofencing and location tracking platform
https://radar.com
Apache License 2.0
171 stars 32 forks source link

3.13.0 add android onActivityCreate to example permission request popups #319

Closed ShiCheng-Lu closed 3 months ago

ShiCheng-Lu commented 4 months ago

To configure the activity for radar, so that permission requests can be used, users should call onActivityCreate with the activity and application context from MainActivity.java onCreate()

initialize activity for radar
+ import io.radar.react.RNRadarModule;

public class MainActivity extends ReactActivity {
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    // Set the theme to AppTheme BEFORE onCreate to support 
    // coloring the background, status bar, and navigation bar.
    // This is required for expo-splash-screen.
    setTheme(R.style.AppTheme);
    super.onCreate(null);
+    RNRadarModule.onActivityCreate(this, getApplicationContext());
  }

  ...
}
lmeier commented 4 months ago

@ShiCheng-Lu looks like tests are failing here