cowbell / cordova-plugin-geofence

Geofencing plugin for cordova
Apache License 2.0
264 stars 318 forks source link

Notifications are not working on latest android version >= 8 #301

Closed Pratikshakhandagale closed 4 years ago

kabubi commented 4 years ago

You try with this plugin? https://github.com/gemigkaka/cordova-plugin-geofence i dont try yet but i read the works with android 8+

Pratikshakhandagale commented 4 years ago

Fixed this issue by writing below code while app loading -

checkPermission() { this.androidPermissions.checkPermission(this.androidPermissions.PERMISSION.ACCESS_COARSE_LOCATION).then(
      result => {
        if (result.hasPermission) {
          console.log('Has permission?', result.hasPermission);
        } else {
          //If not having permission ask for permission
   this.androidPermissions.requestPermissions([this.androidPermissions.PERMISSION.ACCESS_COARSE_LOCATION])
        }
      },
      err => {
        alert(err);
      }
    );
  }
Pratikshakhandagale commented 4 years ago

You try with this plugin? https://github.com/gemigkaka/cordova-plugin-geofence i dont try yet but i read the works with android 8+

@kabubi - Thanks for reply. I fixed this issue, please check my above comment.

digvijayLogistic commented 4 years ago

Hello @Pratikshakhandagale

This plugins is works in background also ? If it works in background, Can you please provide some code for help me. because i didn't get notification at background or foreground.