cordova-plugin-radar icon indicating copy to clipboard operation
cordova-plugin-radar copied to clipboard

Use config.xml to add and configure the plugin

Open S-AT opened this issue 5 years ago • 5 comments
trafficstars

The plugin installation requires manual modifications of Info.plist, android.manifest, AppDelegate.m, MainApplication.java etc.

However, the plugin might use the app config.xml to omit the manual modifications of platforms' code.

We already can add the required changes to Info.plist like this: (Official documentation is misleading in this part)

<platform name="ios">
  <edit-config file="*-Info.plist" mode="overwrite" target="UIBackgroundModes">
    <array>
      <string>fetch</string>
      <string>location</string>
    </array>
  </edit-config>
  <edit-config target="NSLocationAlwaysAndWhenInUseUsageDescription" file="*-Info.plist" mode="overwrite">
    <string>Map requires your current location. Mind to share?</string>
  </edit-config>
  ...
</platform>

It would be great to pass publishableKey using plugin variable. So we haven't to touch AppDelegate.m and MainApplication.java:

<plugin name="cordova-plugin-radar">
    <variable name="publishableKey" value="your-key-goes-here" />
</plugin>

Can it be implemented?

S-AT avatar Aug 21 '20 22:08 S-AT

Great idea, should be possible. Want to try to implement it yourself and open a PR? If not, we can add it to our backlog. Thanks!

nickpatrick avatar Aug 24 '20 17:08 nickpatrick

@nickpatrick , thank you for your reply,

It's really possible, some other plugins have implemented this feature.

Unfortunately, I'm not familiar enough with java/Obj-C (that's why I'm using cordova). So it would be great if someone more experienced did this.

Thanks!

S-AT avatar Aug 24 '20 19:08 S-AT

Cool, we'll try to get to this soon! Thanks again.

nickpatrick avatar Aug 24 '20 19:08 nickpatrick

Please provide an ETA on this issue, as we have to plan our work too. Thanks.

S-AT avatar Sep 14 '20 17:09 S-AT

#25 added the ability to set the publishable key dynamically.

fmendoza avatar Oct 29 '21 15:10 fmendoza