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

Remote Config seems not work on iOS #850

Open
ColDrekken opened this issue Sep 15, 2018 · 8 comments
Open

Remote Config seems not work on iOS #850

ColDrekken opened this issue Sep 15, 2018 · 8 comments

Comments

@ColDrekken
Copy link

Describe the bug
I use the following code in platform ready function to fetch values from firebase remote config. This code works fine on Android but not on iOS.

window.FirebasePlugin.fetch(600,function (returnValue) { console.log("RC fetch" + returnValue); window.FirebasePlugin.activateFetched(function (isActivated) { console.log("RC activateFetched" + isActivated); //Check if the fetched remote config is activated if (isActivated) { window.FirebasePlugin.getValue("shuffle_limit_days", function (value) { console.log("RC VALUE LIMIT"+ value); $rootScope.rcdata.shuflle_limit_days = value; }, function (error){ console.error(error); }); } }); });

returnValue for fetch returns "null" at any time on iOS while it returns "OK" on Android.

Plugin Version
2.0.1

Smartphone (please complete the following information):

  • Device: iphone 6s
  • OS: 11.4.1
    IONIC V1.3.2
@briantq
Copy link
Contributor

briantq commented Sep 18, 2018

@ColDrekken Sounds like there might be a bug. With no full time developers on this plugin, it relies on community members to submit pull requests. If you would like to try to fix this, it should be pretty straight forward to find the code. You can find the JS API in firebase.js and the native iOS code in FirebasePlugin.m. You should be able to put break points in the native code and debug what is going on.

Please check out our Contribution Guidelines if you are interested in submitting a patch as that has all the information you need. Additionally, feel free to ask questions if you get stuck.

@soumak77
Copy link
Contributor

@ColDrekken could you test PR #870 to see if it resolves this issue? If so, I'll merge the PR and get a new release out.

@ColDrekken
Copy link
Author

@soumak77 how can i test this?

@soumak77
Copy link
Contributor

@ColDrekken I updated our contributing doc to answer your question

@soumak77
Copy link
Contributor

@ColDrekken PR #870 has been merged, you can test the fix by installing the plugin from the master branch: cordova plugin add https://github.com/arnesson/cordova-plugin-firebase.git#master

@ColDrekken
Copy link
Author

@soumak77 hello, i tested it but it seems no change on behavior.

returnValue for fetch returns "null" at any time on iOS while it returns "OK" on Android.

@matthieup240
Copy link

matthieup240 commented Oct 19, 2018

I have the same issue on IOS the activateFetched function return "null".

`window.FirebasePlugin.fetch(60, () => {

    window.FirebasePlugin.activateFetched((isActivated) => {
      console.log(isActivated);
      //Check if the fetched remote config is activated
      if (isActivated) {
        window.FirebasePlugin.getValue("last_version_update", (value) => {
          console.log(value);
        }, (error) => {
          console.error(error);
        });
      }
    }, function (err) {
      console.log(err);
      alert(err);
    });
  });`

I always have the alert popup returning "null" on IOS platform with the master and 2.0.5 version :/

@briantq
Copy link
Contributor

briantq commented Oct 19, 2018

@ColDrekken @Tux240 if you can reproduce this 100% of the time on iOS, I would suggest you put a break point in the native code. That should help you figure out if the problem is that Google is not sending the right value down to the client or if there is an bug in the native code when passing it to the javascript. Hopefully it should be pretty straight forward to diagnose.

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

No branches or pull requests

4 participants