Skip to content

Commit

Permalink
Add legalNotice constant (react-native-maps#1458)
Browse files Browse the repository at this point in the history
  • Loading branch information
threesquared authored and codedre committed Aug 15, 2017
1 parent 8df4817 commit 1baacd5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,17 @@
import com.facebook.react.uimanager.UIBlock;
import com.facebook.react.uimanager.UIManagerModule;
import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.common.GoogleApiAvailability;

import java.io.ByteArrayOutputStream;
import java.io.Closeable;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;

import java.util.Map;
import java.util.HashMap;

import javax.annotation.Nullable;

public class AirMapModule extends ReactContextBaseJavaModule {
Expand All @@ -40,6 +44,13 @@ public String getName() {
return "AirMapModule";
}

@Override
public Map<String, Object> getConstants() {
final Map<String, Object> constants = new HashMap<>();
constants.put("legalNotice", GoogleApiAvailability.getInstance().getOpenSourceSoftwareLicenseInfo(getReactApplicationContext()));
return constants;
}

public Activity getActivity() {
return getCurrentActivity();
}
Expand Down
3 changes: 3 additions & 0 deletions lib/ios/AirGoogleMaps/AIRGoogleMapManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,9 @@ - (UIView *)view
}];
}

- (NSDictionary *)constantsToExport {
return @{ @"legalNotice": [GMSServices openSourceLicenseInfo] };
}

- (void)mapViewDidFinishTileRendering:(GMSMapView *)mapView {
AIRGoogleMap *googleMapView = (AIRGoogleMap *)mapView;
Expand Down

0 comments on commit 1baacd5

Please sign in to comment.