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

iOS 10 didn't work #234

Closed
haxpor opened this issue Nov 7, 2016 · 5 comments
Closed

iOS 10 didn't work #234

haxpor opened this issue Nov 7, 2016 · 5 comments
Assignees

Comments

@haxpor
Copy link

haxpor commented Nov 7, 2016

Branch works well on iOS 8, but for iOS 10 it didn't open the app even though I've installed it.

I tested on iOS 10 both on Simulator and real device.

@renesansz
Copy link
Contributor

hello @haxpor ,
can you provide more details in regards to the issue? (eg: Cordova version, Plugin version, steps to reproduce the bug, error logs, and etc.)
thanks!

@haxpor
Copy link
Author

haxpor commented Nov 7, 2016

Here is info

Cordova CLI: 6.3.1
Gulp version:  CLI version 1.2.2
Gulp local:   Local version 3.9.1
Ionic CLI Version: 2.1.4
Ionic App Lib Version: 2.1.2
ios-deploy version: 1.8.6
ios-sim version: 5.0.8
OS: Mac OS X Sierra
Node Version: v4.6.0
Xcode version: Xcode 8.0 Build version 8A218a

I can ensure that I properly set up Branch.io dashboard, input correct branch_key, and uri scheme. I can see information of data object returned when initialize branch in code properly, and aligned with branch_key I use.

The weird thing is that whenever I test with iOS 10 either simulator or real device, it won't switch to the app (in case of installed app, then click on the marketing link).

@ethanneff
Copy link
Contributor

Hello @haxpor,

Thank you for reaching out. Branch should work for iOS 10. I did the following sample app in iOS 10.0.2 and Branch Deep Linking is working.

Sample Test App

1) install

npm install -g cordova ionic;
ionic start t3 tabs;
cd t3;
ionic platform add ios;
ionic platform add android;
ionic plugin remove io.branch.sdk;
# values should be from your Branch Dashboard https://dashboard.branch.io/settings/link
ionic plugin add https://github.com/BranchMetrics/Cordova-Ionic-PhoneGap-Deferred-Deep-Linking-SDK.git --variable BRANCH_KEY=key_live_jnBhaHwt5K8xtn4g4hblHoleqsocI6C2 --variable URI_SCHEME=branchionic;

2) update config.xml

<!-- values should be from your Branch Dashboard https://dashboard.branch.io/settings/link -->
<widget id="com.eneff.branch.ionic" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
  <branch-config>
    <ios-team-id value="PW4Q8885U7"/>
    <host name="cluv.app.link" scheme="https"/>
    <host name="cluv-alternate.app.link" scheme="https"/>
  </branch-config>

3) update app.js

// global function
function DeepLinkHandler(data) {
  if (data) {
    alert('Data Link handler response: ' + JSON.stringify(data));
  }
}

angular.module('starter', ['ionic', 'starter.controllers', 'starter.services'])

.run(function($ionicPlatform) {
  $ionicPlatform.ready(function() {
    if (window.cordova && window.cordova.plugins && window.cordova.plugins.Keyboard) {
      cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
      cordova.plugins.Keyboard.disableScroll(true);
    }
    if (window.StatusBar) {
      StatusBar.styleDefault();
    }

    // init Branch
    $ionicPlatform.on('deviceready', function(){
      Branch.setDebug(true);
      Branch.initSession();
    });

    $ionicPlatform.on('resume', function(){
      Branch.setDebug(true);
      Branch.initSession();
    });
  });
})

// ...

4) delete app off device

5) compile ionic

ionic build ios;

6) run on device through xcode

open -a Xcode platforms/ios/t3.xcodeproj;

7) click on a deep link in iMessage to open the app

image

Integrate Branch

I have a feeling your Branch configuration may be incorrect. For iOS 10 to work, you need Universal Links working. Please try the following guide to make sure you have Branch properly installed: https://gist.github.com/ethanneff/614e56fa3d3f98c03beaa07c66e6ccbe

Best,

@ethanneff ethanneff self-assigned this Nov 7, 2016
@haxpor
Copy link
Author

haxpor commented Nov 8, 2016

@ethanneff Thanks for suggested solution. I took a peek at the integration link. I might have to delete the app, before trying it again. I'll come back here once I have a chance to test it out.

@ethanneff
Copy link
Contributor

Hello @haxpor,

If the above solution did not work, we have updated our SDK to fix the NPM issue. All you will have to do is update to the latest Branch SDK:

change xxxx's to the values in your Branch Dashboard

npm install -g cordova;

cordova platform remove ios;
cordova platform remove android;
cordova platform remove browser;


cordova platform add ios;
cordova platform add android;

cordova plugin remove io.branch.sdk;

cordova plugin add branch-cordova-sdk --variable BRANCH_KEY=x --variable URI_SCHEME=xxxx;

Thank you for your patience.

Best

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