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

config format discrepency #283

Closed
sfeast opened this issue Mar 3, 2017 · 9 comments
Closed

config format discrepency #283

sfeast opened this issue Mar 3, 2017 · 9 comments

Comments

@sfeast
Copy link

sfeast commented Mar 3, 2017

When installing older releases of the plugin I'm seeing:

Error: BRANCH SDK: Invalid "branch-key" in <branch-config> in your config.xml. Docs https://goo.gl/GijGKP

I'm using the older format of including the branch key & uri scheme in the "cordova plugin add branch-cordova-sdk" command so thinking something is getting included that expects the latest format as described on the latest README.md.

@ethanneff
Copy link
Contributor

Hello @sfeast,

Thank you for reaching out.

Can you help answer some questions so I can better troubleshoot your issue?

  1. How are you getting this error?
  2. Are you coming from an older version of the Branch SDK and updating to the latest 2.5.0?
  3. Does your config.xml look something like this?
<!-- sample config.xml -->
<widget id="com.eneff.branch.cordova_testbed" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
  <!-- Branch -->
  <plugin name="branch-cordova-sdk" />
  <branch-config>
    <branch-key value="key_live_ndqptlgXNE4LHqIahH1WIpbiyFlb62J3" />
    <uri-scheme value="cordovatestbed" />
    <link-domain value="cordova.app.link" />
    <ios-team-release value="PW4Q8885U7" />
  </branch-config>

@sfeast
Copy link
Author

sfeast commented Mar 3, 2017

Thanks @ethanneff

1st I should have mentioned that this is so far iOS specific (haven't tested on android)

For your questions:

  1. I'm using a custom cordova build process but I think I can break down the basic steps with:
    i. create a new cordova project with the bundle id set on my branch dashboard
    ii. Run "cordova platforms add ios"
    iii. edit my cordova.xml file to include something like:
<!-- sample config.xml -->
<widget id="com.eneff.branch.cordova_testbed" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
  <!-- Branch -->
   <plugin name="branch-cordova-sdk" spec="^2.2.5">
      <variable name="BRANCH_KEY" value="<my branch key>" />
      <variable name="URI_SCHEME" value="<my uri scheme>" />
    </plugin>
  <branch-config>
      <ios-team-id value="<my team id>" />
      <host name="bnc.lt" scheme="https" />
  </branch-config>

iv. Run "cordova prepare"

& I believe this is where the error comes (again actually running in a custom build process so I'd need to manually go through this to be 100% - which isn't a problem if needed, let me know)

  1. I've tried re-building against v2.2.5 (the last version that I was using successfully) & also against 2.4.0, same results.

  2. See above.

Thanks again!

@ethanneff
Copy link
Contributor

Hello again,

So the reason why your app is pulling the latest version is because you have <plugin name="branch-cordova-sdk" spec="^2.2.5"> within your config.xml. This auto updates your SDK every time you build your app. Branch never fully supported importing the SDK this way with our previous versions, which is part of the problem.

The old way of importing the SDK was as follows:

cordova plugin rm io.branch.sdk
cordova plugin add branch-cordova-sdk@2.2.5 --variable BRANCH_KEY=xxxx --variable URI_SCHEME=xxxx

You can do the above and remove <plugin name="branch-cordova-sdk" spec="^2.2.5"> from you config.xml, or your can update your config.xml to the latest syntax of Branch:

<!-- sample config.xml -->
<widget id="com.eneff.branch.example" version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
  <!-- Branch -->
  <plugin name="branch-cordova-sdk" spec="~2.4.2" /> <!-- optional spec -->
  <branch-config>
    <branch-key value="key_live_ndqptlgXNE4LHqIahH1WIpbiyFlb62J3" />
    <uri-scheme value="cordovatestbed" />
    <link-domain value="testbed.app.link" />
    <ios-team-release value="PW4Q8885U7" />
    <ios-team-debug value="FG35JLLMXX" /> <!-- optional -->
    <android-prefix value="/WSuf" /> <!-- optional (for bnc.lt) -->
    <android-testmode value="true" /> <!-- optional (simulate installs) -->
  </branch-config>

Updating your config.xml approach may be a little more challenging since we did have another big update at 2.4.0 which changed the way handle deep link data into your app.

Best,

@sfeast
Copy link
Author

sfeast commented Mar 3, 2017

Thanks @ethanneff, pretty sure I'm clear on what needs to be done here, thanks so much for the thorough explanation!!

@vomchik
Copy link

vomchik commented Mar 6, 2017

@ethanneff
Copy link
Contributor

Hello @vomchik,

Thank you for bringing this to my attention. I will add this logic to our SDK and hopefully get a release as early as tomorrow. I will keep you updated.

Best,

@vomchik
Copy link

vomchik commented Mar 6, 2017

Thanks!

@ethanneff
Copy link
Contributor

Hello @vomchik,

I have added the logic into our SDK. You can now use android-packageName and ios-CFBundleIdentifier instead of id within your config.xml

code change f05ae30
pull request #294

Using the latest version of the Branch SDK (v2.5.5) should fix your issue.

Thanks in advance,

@vomchik
Copy link

vomchik commented Mar 8, 2017

Thanks!

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