Pushwoosh / pushwoosh-phonegap-plugin

Pushwoosh PhoneGap Build Plugin
Other
109 stars 139 forks source link

What happened to startLocationTracking #350

Closed joe-at-startupmedia closed 3 years ago

joe-at-startupmedia commented 3 years ago

My cordova project now throws an error: pushwoosh.startLocationTracking is not a function

I found that the startLocationTracking method was removed from the PushNotification.java file. How to replicate debugging of the missing method.

➜  pushwoosh-phonegap-plugin git:(master) cat package.json| grep version
  "version": "8.1.2",
➜  pushwoosh-phonegap-plugin git:(master) grep -rin startLocationTracking src
src/ios/Pushwoosh.framework/Versions/A/Headers/PushNotificationManager.h:322:- (void)startLocationTracking __attribute__((deprecated("Use PushwooshGeozones framework")));
src/ios/Pushwoosh.framework/Versions/A/Headers/PushNotificationManager.h:332: Explicitly sends geolocation to the server for GeoFencing push technology. Also called internally, please use `startLocationTracking` and `stopLocationTracking` functions.
Binary file src/ios/Pushwoosh.framework/Versions/A/libPushwoosh.a matches
src/windows/PushwooshPluginProxy.js:66:    startLocationTracking: function (success, fail) {
src/wp8/PushNotification.cs:195:        public void startLocationTracking(string options)
➜  pushwoosh-phonegap-plugin git:(master) git checkout 6.5.3
Note: checking out '6.5.3'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b new_branch_name

HEAD is now at ae9d0e6... Pushwoosh Cordova Plugin 6.5.3
➜  pushwoosh-phonegap-plugin git:(ae9d0e6) cat package.json| grep version
  "version": "6.5.3",
➜  pushwoosh-phonegap-plugin git:(ae9d0e6) grep -rin startLocationTracking src
src/android/src/com/pushwoosh/plugin/pushnotifications/PushNotifications.java:435:  private boolean startLocationTracking(JSONArray data, final CallbackContext callbackContext)
src/ios/Pushwoosh.framework/Versions/A/Headers/PushNotificationManager.h:224: Sends geolocation to the server for GeoFencing push technology. Called internally, please use `startLocationTracking` and `stopLocationTracking` functions.
src/ios/Pushwoosh.framework/Versions/A/Headers/PushNotificationManager.h:233:- (void)startLocationTracking;
Binary file src/ios/Pushwoosh.framework/Versions/A/Pushwoosh matches
src/ios/PushNotification.m:214:- (void)startLocationTracking:(CDVInvokedUrlCommand *)command {
src/ios/PushNotification.m:215: [[PushNotificationManager pushManager] startLocationTracking];
src/windows/PushwooshPluginProxy.js:56: startLocationTracking: function(success, fail) {
src/wp8/PushNotification.cs:195:        public void startLocationTracking(string options)
joe-at-startupmedia commented 3 years ago

Looks like it was removed beginning in 7.13.0 https://github.com/Pushwoosh/pushwoosh-phonegap-plugin/commit/24b01319cb646d802e22fc1404745b44edce5861#diff-50ca24611a4d8ceb67b70806155d3c4890d197aaaeb0745678df2551acd61ef2

wfhm commented 3 years ago

@joe-at-startupmedia

It was moved to a separate plugin:

https://github.com/Pushwoosh/pushwoosh-geozones-cordova-plugin

Integration guide can be found here:

https://docs.pushwoosh.com/platform-docs/pushwoosh-sdk/cross-platform-frameworks/cordova/customizing-cordova-plugin#geozones-push-notifications