Skip to content
This repository has been archived by the owner on Sep 4, 2020. It is now read-only.

Remove sender id from PushNotification init Android options #689

Closed
restarian opened this issue Mar 10, 2016 · 5 comments
Closed

Remove sender id from PushNotification init Android options #689

restarian opened this issue Mar 10, 2016 · 5 comments

Comments

@restarian
Copy link

The sender id in version 1.6.0+ is now available as a plugin variable, thusly should be omitted from app front-end script.

[Notification_Peripheral] Plugin error with the PushNotification process {
  "0": Error: No value for senderID
    at fail (file:///android_asset/www/plugins/phonegap-plugin-push/www/push.js:56:49)
    at Object.cordova.callbackFromNative (file:///android_asset/www/phonegap.js:293:52)
    at processMessage (file:///android_asset/www/phonegap.js:1079:17)
    at processMessages (file:///android_asset/www/phonegap.js:1102:9)
    at pollOnce (file:///android_asset/www/phonegap.js:971:9)
    at pollOnceFromOnlineEvent (file:///android_asset/www/phonegap.js:958:5)
}
@macdonst
Copy link
Member

@surgemcgee Yes, that is the plan but I'm waiting until a 2.0.0 release as I don't want to make a breaking API change.

@macdonst macdonst added this to the Release 2.0.0 milestone Mar 10, 2016
@jakub-g
Copy link
Contributor

jakub-g commented Mar 11, 2016

In fact just FYI it was already a breaking change with 1.6.0 release kind of.

I'm using ionic and a build script does ionic state restore to install platforms and plugins (which reads package.json and install stuff with proper versions and variables)

When I bumped version from 1.5.3 to 1.6.0 in package.json and let my scripts run, it failed due to missing SENDER_ID configuraton.

I had to change

to

{
  "variables": {
    "SENDER_ID": "........"
  },
  "locator": "[email protected]",
  "id": "phonegap-plugin-push"
},

If someone had ^1.5.3 in package.json, or unspecified version, their automated CI build would take 1.6.0 and fail.

That's why I prefer strict versions in package.json to have control over the update process :)

cmprescott pushed a commit to cmprescott/phonegap-plugin-push that referenced this issue Mar 16, 2016
- Prefer explicitly defined SENDER_ID from the plugin's JS.
- I believe this resolves phonegap#689 without breaking existing compatibility.
cmprescott pushed a commit to cmprescott/phonegap-plugin-push that referenced this issue Mar 16, 2016
- Prefer explicitly defined SENDER_ID from the plugin's JS.
- I believe this resolves phonegap#689 without breaking existing compatibility.
cmprescott pushed a commit to cmprescott/phonegap-plugin-push that referenced this issue Mar 16, 2016
- Prefer explicitly defined SENDER_ID from the plugin's JS.
- I believe this resolves phonegap#689 without breaking existing compatibility.
- Add Android helper function to get 'google_app_id' parameter. This is pretty ugly code. I welcome refactoring from someone more familiar with Android best practices. The closest StackOverflow I found was http://stackoverflow.com/questions/24453018/plugin-preferences-in-config-xml
cmprescott pushed a commit to cmprescott/phonegap-plugin-push that referenced this issue Mar 22, 2016
- Prefer explicitly defined SENDER_ID from the plugin's JS.
- I believe this resolves  without breaking existing compatibility.
- Add Android helper function to get 'google_app_id' parameter. This is pretty ugly code. I welcome refactoring from someone more familiar with Android best practices. The closest StackOverflow I found was http://stackoverflow.com/questions/24453018/plugin-preferences-in-config-xml
@ujjal008
Copy link

ujjal008 commented May 13, 2016

Console showing:

Ionic Core: init
ionic.io.bundle.min.js:2 Ionic Core: searching for cordova.js
ionic.io.bundle.min.js:2 Ionic Core: attempting to mock plugins
ionic.io.bundle.min.js:2 Ionic Push: register
ionic.io.bundle.min.js:3 Uncaught TypeError: Cannot read property 'init' of undefined

But when I install on device not get devicetoken. call back function not working:

Here is my code:

.run(function($ionicPlatform) {
$ionicPlatform.ready(function() {
alert("push")
var push = new Ionic.Push({
"debug": true
});

push.register(function(token) {
  alert(token);

  //alert("Device token:",token.token);
  push.saveToken(token);  // persist the token in the Ionic Platform
});

});
})

macdonst added a commit that referenced this issue May 25, 2017
* Added partial Android FCM support (#975)

* Modified plugin.xml to include FCM changes

* Plugin.xml changes for FCM

* Java changes for FCM

* Increased plugin version to 2.0.0

* Increased plugin version in package.json

* Added topic subscription/unsubscription

* Removed some empty lines

* Fixed empty token on android first run (#1008)

* Removed GCM files and added FCM files

* Added .framework files as custom frameworks

* Changed code to work with FCM

* Added hook and resource file to copy GoogleService-Info.plist

* fixed registration and removed unused code

* Use CocoaPods

* Fix rebase errors

* Fix topic subscription and unsubscription on FCM

* Refactor GCMIntentService to FCMService

* Issue #689: Remove sender id from PushNotification init Android options

* Issue #689: Remove sender id from PushNotification init iOS options

* 📝 Update to using fcm-node

* 🐛 Issue #1188: Strings.xml google_app_id conflict with google-services.json

* Add empty google services plist

* Pin FCM to 9.8.0

* 🔧 Add browser platform back for FCM branch

* 🔨🔧⬆️ Use Babel to transpile ES2015 code

* 🔧 add tern to gitignore

* 🔖 Bumping plugin version to 2.0.0-rc1

* 2.0.0-rc1

* Updating CHANGELOG

* Fixing my merge error for PR #1378 Optional event emit instead of function call for action buttons

* 🐛🍎 Issue #1461: App crashes when initialising with topics (v2.0.0-rc1)

* 🐛🐧📝⬆️ #1460: Build Issue Android

* 🐛🍎🔧 Fixing a merge issue where aps-environment was accidentally removed

* 🐧📝🐛 Issue #1470: Cannot install phonegap-plugin-push on master

* 📝 Using a newer version on the examples

* 🍎🐛 Issue #1497: App crashes after refreshing when using FCM (v2)

* Bumping plugin version to 2.0.0-rc2

* 2.0.0-rc2

* Updating CHANGELOG

* Added partial Android FCM support (#975)

* Modified plugin.xml to include FCM changes

* Plugin.xml changes for FCM

* Java changes for FCM

* Increased plugin version to 2.0.0

* Increased plugin version in package.json

* Added topic subscription/unsubscription

* Removed some empty lines

* Removed GCM files and added FCM files

* Changed code to work with FCM

* Added hook and resource file to copy GoogleService-Info.plist

* Use CocoaPods

* Fix rebase errors

* Issue #689: Remove sender id from PushNotification init Android options

* 🐛 Issue #1188: Strings.xml google_app_id conflict with google-services.json

* Pin FCM to 9.8.0

* 🔧 Add browser platform back for FCM branch

* 🔨🔧⬆️ Use Babel to transpile ES2015 code

* 🔧 add tern to gitignore

* 🔖 Bumping plugin version to 2.0.0-rc1

* 🐛🐧📝⬆️ #1460: Build Issue Android

* Bumping plugin version to 2.0.0-rc2

* Added partial Android FCM support (#975)

* Modified plugin.xml to include FCM changes

* Plugin.xml changes for FCM

* Java changes for FCM

* Increased plugin version to 2.0.0

* Increased plugin version in package.json

* Added topic subscription/unsubscription

* Removed some empty lines

* Removed GCM files and added FCM files

* Added hook and resource file to copy GoogleService-Info.plist

* Use CocoaPods

* Fix rebase errors

* 🐛 Issue #1188: Strings.xml google_app_id conflict with google-services.json

* Updating CHANGELOG

* ✏️ fixing error in CHANGELOG

* Bumping plugin version to 2.0.0-rc2

* Updating CHANGELOG

* Added partial Android FCM support (#975)

* Modified plugin.xml to include FCM changes

* Plugin.xml changes for FCM

* Java changes for FCM

* Increased plugin version to 2.0.0

* Increased plugin version in package.json

* Added topic subscription/unsubscription

* Removed some empty lines

* Removed GCM files and added FCM files

* Changed code to work with FCM

* Added hook and resource file to copy GoogleService-Info.plist

* fixed registration and removed unused code

* Use CocoaPods

* Fix rebase errors

* Issue #689: Remove sender id from PushNotification init Android options

* Issue #689: Remove sender id from PushNotification init iOS options

* 🐛 Issue #1188: Strings.xml google_app_id conflict with google-services.json

* 🔧 add tern to gitignore

* 🔖 Bumping plugin version to 2.0.0-rc1

* Bumping plugin version to 2.0.0-rc2

* Remove hook and use resource-file tag to copy google services file

* Add resource-file way of copying google services files

* Bump requirements

* 🔧 Update cordovaDependencies

* 🔖 Bumping plugin version to 2.0.0-rc3

* 2.0.0-rc3

* Updating CHANGELOG

* Fixes 'framework not found GoogleToolboxForMac' linker error in 2.0.0-rc3 (#1715)

* Remove unused files (#1732)

* Remove GTM framework. (#1739)
@macdonst macdonst removed the staging label Jun 16, 2017
@macdonst
Copy link
Member

Closing as it is part of released RC's.

@lock
Copy link

lock bot commented Jun 3, 2018

This thread has been automatically locked.

@lock lock bot locked as resolved and limited conversation to collaborators Jun 3, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

4 participants