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

Branch.loadRewards() on cordova no results for custom bucket #179

Closed
chris08002 opened this issue Jul 30, 2016 · 4 comments
Closed

Branch.loadRewards() on cordova no results for custom bucket #179

chris08002 opened this issue Jul 30, 2016 · 4 comments

Comments

@chris08002
Copy link

chris08002 commented Jul 30, 2016

On ionic/cordova the function loadRewards() returns an integer (number of credits in default bucket). So I can not get info on the credit in custom buckets.

Branch.loadRewards().then(function (rewards) {
  console.log("rew", rewards);
  // will return the balance of the current user's credits
  $scope.credits = rewards['beer'];
}).catch(function (err) {
  console.error(err);
});

According to documentation it should return an array or object with the different buckets and their credit status.

This is refering to my post in stackoverflow:
http://stackoverflow.com/questions/38654869/branch-io-with-cordova-branch-loadrewards-no-results

And also to my branch.io support request.

@renesansz
Copy link
Contributor

Hey @chris08002 ,
I'll take a look on the issue and hopefully provide a fix asap.

@renesansz
Copy link
Contributor

renesansz commented Jul 31, 2016

@chris08002 ,
I think there's a misunderstanding w/ what the Branch.IO documentation tells about the loadRewards return, it doesn't return an object/array but only an integer (Typo in the documentation I guess?).

However, I've modified loadRewards to accept a string parameter so that you can specify a bucket to load a reward.

Hopefully PR #180 caters your problem.
Let me know if this works for you. 👌

@renesansz
Copy link
Contributor

@chris08002 , PR has been merged.
Is this issue now resolved?

@aaustin
Copy link
Contributor

aaustin commented Aug 14, 2016

Done.

@aaustin aaustin closed this as completed Aug 14, 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

3 participants