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

data.azureRegId #3

Open
jimseiwert opened this issue Nov 1, 2018 · 4 comments
Open

data.azureRegId #3

jimseiwert opened this issue Nov 1, 2018 · 4 comments

Comments

@jimseiwert
Copy link

on registration I am getting back undefined for data.azureRegId. I am also not seeing any activity in the azure notification hub for this registration. Am I missing something on registration?

` this.push = PushNotification.init({
notificationHubPath: "{{hub name}}",
connectionString:
"Endpoint={{connectionstring}}",
android: {
sound: true
},
ios: {
alert: "true",
badge: true,
sound: "false"
}
});

this.push.on("registration", function(data) {
  console.log("registering");
  console.log(data);
  console.log(data.registrationId);
});

this.push.on("error", function(err) {
  console.log(err);
});

this.push.on("notification", function(data) {
  console.log(data.message);
  console.log(data.title);
  console.log(data.count);
  console.log(data.sound);
  console.log(data.image);
  console.log(data.additionalData);
  alert(JSON.stringify(data));
});`
@derek82511
Copy link
Owner

Hi jimseiwert,
Could you show me your device os version and cordova version?
So that I can test it for you.

@derek82511
Copy link
Owner

on registration I am getting back undefined for data.azureRegId. I am also not seeing any activity in the azure notification hub for this registration. Am I missing something on registration?

` this.push = PushNotification.init({
notificationHubPath: "{{hub name}}",
connectionString:
"Endpoint={{connectionstring}}",
android: {
sound: true
},
ios: {
alert: "true",
badge: true,
sound: "false"
}
});

this.push.on("registration", function(data) {
  console.log("registering");
  console.log(data);
  console.log(data.registrationId);
});

this.push.on("error", function(err) {
  console.log(err);
});

this.push.on("notification", function(data) {
  console.log(data.message);
  console.log(data.title);
  console.log(data.count);
  console.log(data.sound);
  console.log(data.image);
  console.log(data.additionalData);
  alert(JSON.stringify(data));
});`

Hi jimseiwert,
Could you show me your device os version and cordova version?
So that I can test it for you.

@AadityaDev
Copy link

I am facing the same error on android. Fix is to add

  1. useLibrary 'org.apache.http.legacy' .  in app>build.gradle
    
  2. Add this inside application tag

@AadityaDev
Copy link

<uses-library android:name="org.apache.http.legacy" android:required="false" />

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