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 shareText/shareTitle and other "localization" properties #235

Closed
chancezeus opened this issue Nov 7, 2016 · 1 comment
Closed

iOS shareText/shareTitle and other "localization" properties #235

chancezeus opened this issue Nov 7, 2016 · 1 comment
Assignees

Comments

@chancezeus
Copy link

On iOS if you try to use the localization option as an object with the text/title/etc properties, everything get's inserted as a text blob (including the copyToClipboard and other "non relevant" keys).

Looking at the code in cordova-ionic-phonegap-branch-deep-linking/src/ios/dependencies/Branch-SDK/BranchUniversalObject.m on line 181 the shareText is a NSString, later in this method on lines 187 and 229 it looks like the NSString is accessed as a dictionary using valueForKey (which I assume is incorrect, since it is still a NSString not a dictionary). The end result is the entire object being inserted as a string without the properties being parsed and/or used.

@ethanneff
Copy link
Contributor

Hello @chancezeus,

Thank you for reaching out. The localization field is outdated in our documentation. I apologize for this. We are in the process of updating all of our documentation.

Please look at this document and this example for the Branch share sheet feature:
https://gist.github.com/ethanneff/614e56fa3d3f98c03beaa07c66e6ccbe#share-deep-link

// optional fields
var analytics = {
    channel: "channel",
    feature: "feature",
    campaign: "campaign",
    stage: "stage",
    tags: ["one","two","three"]
};

// optional fields
var properties = {
    $fallback_url: "www.example.com",
    $desktop_url: "www.desktop.com",
    $android_url: "www.android.com",
    $ios_url: "www.ios.com",
    $ipad_url: "www.ipad.com",
    more_custom: "data",
    even_more_custom: true,
    this_is_custom: 41231
};

var message = "Check out this link";

// needs a universal object

// optional listeners (must be called before showShareSheet)
branchUniversalObj.onShareSheetLaunched(function(res) {
  // android only
  alert(JSON.stringify(res));
});
branchUniversalObj.onShareSheetDismissed(function(res) {
  alert(JSON.stringify(res));
});
branchUniversalObj.onLinkShareResponse(function(res) {
  alert(JSON.stringify(res));
});
branchUniversalObj.onChannelSelected(function(res) {
  // android only
  alert(JSON.stringify(res));
});

// share sheet
branchUniversalObj.showShareSheet(analytics, properties, message);

@ethanneff ethanneff self-assigned this Nov 7, 2016
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

2 participants