GithubHelp home page GithubHelp logo

dev-hwang / flutter_activity_recognition Goto Github PK

View Code? Open in Web Editor NEW
12.0 12.0 11.0 101 KB

This plugin is used to recognize user activity on Android and iOS platforms.

License: MIT License

Kotlin 50.76% Ruby 6.36% Swift 18.36% Objective-C 2.41% Dart 22.11%
activity android flutter ios recognition

flutter_activity_recognition's People

Contributors

bugthedebugger avatar dev-hwang avatar hwj930513 avatar

Stargazers

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

Watchers

 avatar  avatar  avatar

flutter_activity_recognition's Issues

Use `authorizationStatus` to determine activity permission status

By using authorizationStatus we can determine the permission status without triggering the permission dialog on iOS.

We could replace the code here:

public func checkMotionActivityPermission(handler: @escaping PermissionRequestResultHandler) {
let nowDate = Date()
motionActivityManager.queryActivityStarting(from: nowDate, to: nowDate, to: .main) { (activities, error) in
if let error = error, (error as NSError).code == CMErrorMotionActivityNotAuthorized.rawValue {
handler(PermissionRequestResult.PERMANENTLY_DENIED)
return
}
handler(PermissionRequestResult.GRANTED)
}
}

With something like this:

public func checkMotionActivityPermission(handler: @escaping PermissionRequestResultHandler) {
	  let status = CMMotionActivityManager.authorizationStatus()
	  switch (status) {
	  case .authorized:
		  handler(PermissionRequestResult.GRANTED)
	  case .denied, .restricted:
		  handler(PermissionRequestResult.PERMANENTLY_DENIED)
	  default:
		  handler(PermissionRequestResult.DENIED)
	  }
}

What do you think?

Use requestActivityTransitionUpdates on Android

java.lang.IncompatibleClassChangeError: Found interface com.google.android.gms.location.ActivityRecognitionClient, but class was expected (declaration of 'com.google.android.gms.location.ActivityRecognitionClient'

I see the following crash as soon as i try to use the plugin:

java.lang.IncompatibleClassChangeError: Found interface com.google.android.gms.location.ActivityRecognitionClient, but class was expected (declaration of 'com.google.android.gms.location.ActivityRecognitionClient'

I am running the latest plugin version with these android sdk settings:

compileSdkVersion 33
targetSdkVersion 33
minSdkVersion 23

Trying to upgrade my google play services location to this, did also not work:

    implementation "com.google.android.gms:play-services-location:21.0.1"

is there any way to resolve this?

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.