Giter Site home page Giter Site logo

flutter_geofence's Introduction

Hi there

Amar Ubhe | Twitter Amar Ubhe

Hi, I'm Amar Ubhe, a passionate self-taught SAP Full Stack developer from India.Initially, I started my career as an SAP ABAP developer.I was very interested in new technology learning so I shifted my career to ABAP to Fiori later on Nodejs Application Development.Currently I have experince with various technology which include SAP ABAP, Fiori,OData Services, Process Integration Technology, Restful Application Programming,CloudApplication Programming skills,Java & React Js  

I am also an open-source enthusiast and maintainer. I learned a lot from the open-source community and I love how collaboration and knowledge sharing happened through open-source.

Languages and Tools:

My GitHub Stats:

ubheamar

ubheamar

flutter_geofence's People

Contributors

ubheamar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

flutter_geofence's Issues

Plethora of errors from plugin after implementing the plugin

After I followed the guide and added this plugin I received these errors:

e: /Users/debkanchansamadder/flutter/.pub-cache/hosted/pub.dartlang.org/geofence-1.0.3/android/src/main/kotlin/com/webstersys/geofence/HeadlessJobService.kt: (4, 31): Unresolved reference: JobIntentService
e: /Users/debkanchansamadder/flutter/.pub-cache/hosted/pub.dartlang.org/geofence-1.0.3/android/src/main/kotlin/com/webstersys/geofence/HeadlessJobService.kt: (15, 72): Unresolved reference: JobIntentService
e: /Users/debkanchansamadder/flutter/.pub-cache/hosted/pub.dartlang.org/geofence-1.0.3/android/src/main/kotlin/com/webstersys/geofence/HeadlessJobService.kt: (30, 5): 'onCreate' overrides nothing
e: /Users/debkanchansamadder/flutter/.pub-cache/hosted/pub.dartlang.org/geofence-1.0.3/android/src/main/kotlin/com/webstersys/geofence/HeadlessJobService.kt: (31, 15): Unresolved reference: onCreate
e: /Users/debkanchansamadder/flutter/.pub-cache/hosted/pub.dartlang.org/geofence-1.0.3/android/src/main/kotlin/com/webstersys/geofence/HeadlessJobService.kt: (32, 30): Type mismatch: inferred type is HeadlessJobService but Context was expected
e: /Users/debkanchansamadder/flutter/.pub-cache/hosted/pub.dartlang.org/geofence-1.0.3/android/src/main/kotlin/com/webstersys/geofence/geofence/GeofenceTransitionsJobIntentService.kt: (17, 31): Unresolved reference: JobIntentService
e: /Users/debkanchansamadder/flutter/.pub-cache/hosted/pub.dartlang.org/geofence-1.0.3/android/src/main/kotlin/com/webstersys/geofence/geofence/GeofenceTransitionsJobIntentService.kt: (18, 31): Unresolved reference: NotificationCompat
e: /Users/debkanchansamadder/flutter/.pub-cache/hosted/pub.dartlang.org/geofence-1.0.3/android/src/main/kotlin/com/webstersys/geofence/geofence/GeofenceTransitionsJobIntentService.kt: (19, 31): Unresolved reference: TaskStackBuilder
e: /Users/debkanchansamadder/flutter/.pub-cache/hosted/pub.dartlang.org/geofence-1.0.3/android/src/main/kotlin/com/webstersys/geofence/geofence/GeofenceTransitionsJobIntentService.kt: (43, 77): Type inference failed. Expected type mismatch: inferred type is Class<GeofenceTransitionsJobIntentService> but Intent was expected
e: /Users/debkanchansamadder/flutter/.pub-cache/hosted/pub.dartlang.org/geofence-1.0.3/android/src/main/kotlin/com/webstersys/geofence/geofence/GeofenceTransitionsJobIntentService.kt: (43, 83): Too many arguments for public final fun enqueueWork(context: Context, intent: Intent): Unit defined in com.webstersys.geofence.geofence.GeofenceTransitionsJobIntentService.Companion
e: /Users/debkanchansamadder/flutter/.pub-cache/hosted/pub.dartlang.org/geofence-1.0.3/android/src/main/kotlin/com/webstersys/geofence/geofence/GeofenceTransitionsJobIntentService.kt: (43, 117): Too many arguments for public final fun enqueueWork(context: Context, intent: Intent): Unit defined in com.webstersys.geofence.geofence.GeofenceTransitionsJobIntentService.Companion
e: /Users/debkanchansamadder/flutter/.pub-cache/hosted/pub.dartlang.org/geofence-1.0.3/android/src/main/kotlin/com/webstersys/geofence/geofence/GeofenceTransitionsJobIntentService.kt: (67, 5): 'onHandleWork' overrides nothing
e: /Users/debkanchansamadder/flutter/.pub-cache/hosted/pub.dartlang.org/geofence-1.0.3/android/src/main/kotlin/com/webstersys/geofence/geofence/GeofenceTransitionsJobIntentService.kt: (71, 54): None of the following functions can be called with the arguments supplied: 
public final fun getErrorString(context: Context, e: kotlin.Exception /* = java.lang.Exception */): String defined in com.webstersys.geofence.geofence.GeofenceErrorMessages
public final fun getErrorString(context: Context, errorCode: Int): String defined in com.webstersys.geofence.geofence.GeofenceErrorMessages
e: /Users/debkanchansamadder/flutter/.pub-cache/hosted/pub.dartlang.org/geofence-1.0.3/android/src/main/kotlin/com/webstersys/geofence/geofence/GeofenceTransitionsJobIntentService.kt: (106, 24): Unresolved reference: getString
e: /Users/debkanchansamadder/flutter/.pub-cache/hosted/pub.dartlang.org/geofence-1.0.3/android/src/main/kotlin/com/webstersys/geofence/geofence/GeofenceTransitionsJobIntentService.kt: (140, 36): Unresolved reference: getSystemService
e: /Users/debkanchansamadder/flutter/.pub-cache/hosted/pub.dartlang.org/geofence-1.0.3/android/src/main/kotlin/com/webstersys/geofence/geofence/GeofenceTransitionsJobIntentService.kt: (144, 24): Unresolved reference: getString
e: /Users/debkanchansamadder/flutter/.pub-cache/hosted/pub.dartlang.org/geofence-1.0.3/android/src/main/kotlin/com/webstersys/geofence/geofence/GeofenceTransitionsJobIntentService.kt: (168, 23): Unresolved reference: NotificationCompat
e: /Users/debkanchansamadder/flutter/.pub-cache/hosted/pub.dartlang.org/geofence-1.0.3/android/src/main/kotlin/com/webstersys/geofence/geofence/GeofenceTransitionsJobIntentService.kt: (176, 21): Unresolved reference: resources
e: /Users/debkanchansamadder/flutter/.pub-cache/hosted/pub.dartlang.org/geofence-1.0.3/android/src/main/kotlin/com/webstersys/geofence/geofence/GeofenceTransitionsJobIntentService.kt: (182, 29): Unresolved reference: getString
e: /Users/debkanchansamadder/flutter/.pub-cache/hosted/pub.dartlang.org/geofence-1.0.3/android/src/main/kotlin/com/webstersys/geofence/geofence/GeofenceTransitionsJobIntentService.kt: (205, 58): Unresolved reference: getString
e: /Users/debkanchansamadder/flutter/.pub-cache/hosted/pub.dartlang.org/geofence-1.0.3/android/src/main/kotlin/com/webstersys/geofence/geofence/GeofenceTransitionsJobIntentService.kt: (206, 57): Unresolved reference: getString
e: /Users/debkanchansamadder/flutter/.pub-cache/hosted/pub.dartlang.org/geofence-1.0.3/android/src/main/kotlin/com/webstersys/geofence/geofence/GeofenceTransitionsJobIntentService.kt: (207, 28): Unresolved reference: getString
e: /Users/debkanchansamadder/flutter/.pub-cache/hosted/pub.dartlang.org/geofence-1.0.3/android/src/main/kotlin/com/webstersys/geofence/geofence/GeofencingStore.kt: (7, 24): Unresolved reference: annotation

Manifest:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    package="com.ride.partner">

    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <!-- <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/> -->
    <uses-permission android:name="android.permission.WAKE_LOCK"/>

<!-- TODO: add tools:replace="android:label" and android:name=".MainActivity" to application-->
    <application
        android:name=".Geofence"
        android:label="Partner"
        android:icon="@mipmap/ic_launcher">
        <uses-library android:name="org.apache.http.legacy" android:required="false"/>
        <meta-data android:name="com.google.android.geo.API_KEY"
               android:value="AIzaSyASjLjFYOtDUdX0PfWb6tOYoJciONgoQlU"/>
        <!-- Set custom default icon. This is used when no icon is set for incoming notification messages. See README(https://goo.gl/l4GJaQ) for more. -->
        <meta-data
            android:name="com.google.firebase.messaging.default_notification_icon"
            android:resource="@drawable/ic_stat_notification" />
        <activity
            android:name=".MainActivity"
            android:launchMode="singleTop"
            android:theme="@style/LaunchTheme"
            android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
            android:hardwareAccelerated="true"
            android:windowSoftInputMode="adjustResize">
            <!-- This keeps the window background of the activity showing
                 until Flutter renders its first frame. It can be removed if
                 there is no splash screen (such as the default splash screen
                 defined in @style/LaunchTheme). -->
            <meta-data
                android:name="io.flutter.embedding.android.SplashScreenDrawable"
                android:resource="@drawable/launch_background"/>

            <!-- Theme to apply as soon as Flutter begins rendering frames -->
            <meta-data
                android:name="io.flutter.embedding.android.NormalTheme"
                android:resource="@style/NormalTheme"/>
            <intent-filter>
                <action android:name="android.intent.action.MAIN"/>
                <category android:name="android.intent.category.LAUNCHER"/>
            </intent-filter>
            <intent-filter>
                <action android:name="FLUTTER_NOTIFICATION_CLICK" />
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>
        <receiver   android:name="com.webstersys.geofence.geofence.GeofenceBroadcastReceiver"
                    android:enabled="true"
                    android:exported="true" />
        <service android:name="com.webstersys.geofence.geofence.GeofenceTransitionsJobIntentService" android:enabled="true" android:exported="true"
                    android:permission="android.permission.BIND_JOB_SERVICE"/>
        <receiver android:name="com.webstersys.geofence.BootDeviceReceiver">
                    <intent-filter>
                        <action android:name="android.intent.action.BOOT_COMPLETED"/>
                    </intent-filter>
        </receiver>
        <meta-data
                android:name="flutterEmbedding"
                android:value="2"/>
        <activity
        android:name="com.yalantis.ucrop.UCropActivity"
        android:screenOrientation="portrait"
        android:theme="@style/Theme.AppCompat.Light.NoActionBar"/>
    </application>
</manifest>

Geofence Activity:

package com.ride.partner

import com.webstersys.geofence.geofence.GeofenceTransitionsJobIntentService
import io.flutter.app.FlutterApplication
import io.flutter.plugin.common.PluginRegistry
import io.flutter.plugins.GeneratedPluginRegistrant

class Geofence : FlutterApplication(), PluginRegistry.PluginRegistrantCallback {
    override fun onCreate() {
        super.onCreate();
        GeofenceTransitionsJobIntentService.setPluginRegistrant(this)
    }

    override fun registerWith(registry: PluginRegistry) {
        GeneratedPluginRegistrant.registerWith(registry);
    }
}

Error After Adding The Geofence Plugin To My Project.

After I've added the geofence plugin to my flutter project the below error occurred:
"The Android Gradle plugin supports only Kotlin Gradle plugin version 1.2.51 and higher. Project 'geofence' is using version 1.2.30."

I'm using
windows: 10 64 bit.
android studio code: 1.28.2
flutter version: 0.10.2
dart: v2.1.0
android SDK version: 26.1.1

Plugin Init Fails on Android Devices with API < 23

The plugin does not return a result for calls to Geofence.initialize() when platform is Android and API level is less than 23 (Marshmallow).

In GeofencePlugin.kt, the if-statement that checks API level needs an else-clause that returns a result:

override fun onMethodCall(call: MethodCall, result: Result): Unit {

val args = call.arguments() as? ArrayList<*>
if(call.method.equals(GeofenceConstant.GEOFENCE_INIT_METHOD)){
  Log.d(TAG,"Geofence initializing");
  val callbackHandle = args!![0] as Long
  geofencingStore.setCallbackDispatcher(callbackHandle)
  Log.d(TAG,"Callback dispatcher register successfully with id : "+callbackHandle)
  if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
    Dexter.withActivity(mActivity)
            .withPermissions(REQUIRED_PERMISSIONS)
            .withListener(object : MultiplePermissionsListener{
              override fun onPermissionsChecked(report: MultiplePermissionsReport?) {
                if(report!=null && report.areAllPermissionsGranted()){
                  Log.d(TAG,"Geofence initialized");
                  result.success(true);
                }else{
                  result.error(PERMISSION_DENIED_ERROR,"All permission should be granted to work location functionality",null)
                }
              }
              override fun onPermissionRationaleShouldBeShown(permissions: MutableList<PermissionRequest>?, token: PermissionToken?) {
                  token?.continuePermissionRequest();
              }
            })
            .check()
  }
} // need else-clause to return a result
...

Android location services permissions

Hi, I need support whit this error to get Geofence working:

D/com.webstersys.geofence.GeofencePlugin.Companion: Geofence initializing

D/com.webstersys.geofence.GeofencePlugin.Companion: Callback dispatcher register successfully with id : -3587315638570754854

D/com.webstersys.geofence.GeofencePlugin.Companion: Geofence initialized

I/flutter: Geofence plugin initialzed : true

D/com.webstersys.geofence.GeofencePlugin.Companion: Start Geofence called

D/com.webstersys.geofence.LocationManager: geofence added to store startLocationMonitoring called

I/flutter: Geofence added : true

D/com.webstersys.geofence.LocationManager: 6: RESOLUTION_REQUIRED
    Location settings are not satisfied. Attempting to upgrade location settings 

D/AndroidRuntime: Shutting down VM

and this was the trigger:

Caused by: java.lang.Exception: Location settings are not satisfied. Open Settings & change location settings
        at com.webstersys.geofence.LocationManager$startLocationMonitoring$$inlined$run$lambda$2.onFailure(LocationManager.kt:84)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.