Pushwoosh / pushwoosh-react-native-plugin

Other
57 stars 43 forks source link

Android: getHwid returns empty value #28

Closed fperreault closed 6 years ago

fperreault commented 6 years ago

Hi, Pushwoosh.getHwid returns an empty value on Android so I can’t register any devices. With 5.5.4, 5.5.5 and 5.6.2, same issue. Any idea ?

wfhm commented 6 years ago

@fperreault

I have just tested it and it works fine with the latest (5.6.2) version. Also please note that you do not need to manually call getHwid to register a device - Pushwoosh SDK automatically creates a /registerDevice API request when Pushwoosh.register(); is called.

Could you please provide a bit more details on how you integrate Pushwoosh plugin into your project?

wfhm commented 6 years ago

@fperreault any updates on this one?

fperreault commented 6 years ago

@wfhm Thank you for your following. Sure, we use Pushwoosh.register(); to register devices. Everything work on iOS(register and getHwid), but on Android, register callback is never triggered (nor success nor faillure) and getHwid return a empty value. Please note that Pushwoosh.init(); works. We suspect than we have a conflict with another extension...maybe.

Pushwoosh.init(
  {
    pw_appid: appId,
    project_number: projectNumber
  },
  () => console.log("Pushwoosh init success"),
  e => console.log("Pushwoosh init failed", e)
);
Pushwoosh.register(
        token => {
          console.log("Pushwoosh: success", token);
          this.token = token;
        },
        e => console.log("Pushwoosh: failed", e)
);

Pushwoosh.getHwid(
  (id) => console.log("Pushwoosh: " + id)
);
wfhm commented 6 years ago

@fperreault

It seems to be related to #27 . I have tried 5.7.0 version on Android and it worked perfectly for me, so by any chance could you please provide us with a reproducer?

wfhm commented 6 years ago

@fperreault

Is this issue still persistent with the latest plugin version? Is there a chance to provide us with a reproducer apk/project so we could check it on our side?

wfhm commented 6 years ago

@fperreault

27 Seems to be related to your issue, so there is a chance the solution described there might help you as well. Do you add tools:node="replace" in your AndroidManifest.xml under application tag? If so, merging manifests might lead to this problem, so please try removing it and let us know about the result.

wfhm commented 6 years ago

The issue is only reproducible when adding tools:node="replace" under application tag in AndroidManifest.xml. Removing it solves the issue.

fperreault commented 6 years ago

@wfhm Sorry for the delay. I tried it and, good news, it works now ! Thank you for your help

wfhm commented 6 years ago

@fperreault Thank you for coming back, this is a great news indeed!:)