Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use config.xml to add and configure the plugin #12

Open
S-AT opened this issue Aug 21, 2020 · 5 comments
Open

Use config.xml to add and configure the plugin #12

S-AT opened this issue Aug 21, 2020 · 5 comments

Comments

@S-AT
Copy link

S-AT commented Aug 21, 2020

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?

@nickpatrick
Copy link
Contributor

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!

@S-AT
Copy link
Author

S-AT commented Aug 24, 2020

@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!

@nickpatrick
Copy link
Contributor

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

@S-AT
Copy link
Author

S-AT commented Sep 14, 2020

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

@fmendoza
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants