GithubHelp home page GithubHelp logo

hypertrack / quickstart-flutter Goto Github PK

View Code? Open in Web Editor NEW
4.0 4.0 3.0 33.81 MB

Quickstart app for HyperTrack Flutter SDK

Home Page: https://www.hypertrack.com

License: MIT License

Objective-C 0.25% Ruby 8.91% Swift 2.66% Dart 74.56% Kotlin 0.96% Shell 12.66%

quickstart-flutter's Introduction

Flutter Quickstart for HyperTrack SDK

GitHub hypertrack_plugin

HyperTrack lets you add live location tracking to your mobile app. Live location is made available along with ongoing activity, tracking controls and tracking outage with reasons.

This repo contains an example Flutter app that has everything you need to get started.

For information about how to get started with Flutter SDK, please check this Guide.

How to get started?

Create HyperTrack Account

Sign up for HyperTrack and get your publishable key from the Setup page.

Set up the environment

You need to set up the development environment for Flutter

Clone Quickstart app

Install Dependencies

Run flutter pub get

Update the publishable key

Insert your HyperTrack publishable key to _publishableKey in main.dart

HyperTrack SDK needs Firebase Cloud Messaging to manage on-device tracking as well as enable using HyperTrack cloud APIs from your server to control the tracking.

Run the app

Grant permissions

Grant location and activity permissions (choose "Always Allow" for location).

Start tracking

Press Start tracking button.

To see the device on a map, open the HyperTrack dashboard.

Support

Join our Slack community for instant responses. You can also email us at [email protected]

quickstart-flutter's People

Contributors

aashsub90 avatar ashishsynoriq avatar deniszpua avatar dmitryshapovalov avatar ferologics avatar pavel-kuznetsov-hypertrack avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

quickstart-flutter's Issues

handle app killed scenario of stop tracking state and follow the same state of the app after the app restart

in this sample app sticky notification clicking state scenario not working properly on when app killed from recent apps

Steps to reproduce:
1)run the sample
2)start the tracking
3)press back or home button and kill the app
4>then click on the sticky notification it should open the app with 'Stop Tracking' instead of 'start tracking' since already a previous start tracking process is running there

it is the important thing since apps might kill at any time and restart for the delivery boy android mobile scenario, please provide this fix in the flutter sample itself

Build google-services error while running flutter build command

problem:

flutter build apk --verbose
failed with play-services-location version error

can we get more details on com.google.gms:google-services:4.3.3' version used in following android sdk dependencies used in flutter sdk?

dependencies {
        implementation 'com.hypertrack:hypertrack:4.1.2'
    }

build logs:

Configure project :app
[        ] WARNING: The option 'android.enableR8' is deprecated and should not be used anymore.
[        ] It will be removed in a future version of the Android Gradle plugin, and will no longer allow you to disable R8.
[        ] WARNING: DSL element 'useProguard' is obsolete and will be removed soon. Use 'android.enableR8' in gradle.properties to switch between R8 and Proguard..
[ +275 ms] Dependency resolved to an incompatible version: Dependency(fromArtifactVersion=ArtifactVersion(groupId=com.hypertrack, artifactId=hypertrack, version=4.1.2), toArtifact=Artifact(groupId=com.google.android.gms,
artifactId=play-services-location), toArtifactVersionString=[15.0.1, 17.0.0])
[   +2 ms] FAILURE: Build failed with an exception.
[   +1 ms] * What went wrong:
[        ] Could not determine the dependencies of task ':hypertrack_plugin:compileReleaseAidl'.
[        ] > In project 'app' a resolved Google Play services library dependency depends on another at an exact version (e.g. "[15.0.
[        ]   1, 17.0.0]", but isn't being resolved to that version. Behavior exhibited by the library will be unknown.
[        ]   Dependency failing: com.hypertrack:hypertrack:4.1.2 -> com.google.android.gms:play-services-location@[15.0.1, 17.0.0], b
[        ]   ut play-services-location version was 17.0.0.
[        ]   The following dependencies are project dependencies that are direct or have transitive dependencies that lead to the art
[        ]   ifact with the issue.
[        ]   -- Project 'app' depends on project 'hypertrack_plugin' which depends onto com.hypertrack:hypertrack@{strictly 4.1.2}
[        ]   -- Project 'app' depends on project 'hypertrack_plugin' which depends onto com.hypertrack:[email protected]
[        ]   -- Project 'app' depends on project 'hypertrack_plugin' which depends onto com.google.android.gms:play-services-location
[        ]   @{strictly 17.0.0}
[        ]   For extended debugging info execute Gradle from the command line with ./gradlew --info :app:assembleDebug to see the dep
[        ]   endency paths to the artifact. This error message came from the google-services Gradle plugin, report issues at https://
[        ]   github.com/google/play-services-plugins and disable by adding "googleServices { disableVersionCheck = false }" to your b
[        ]   uild.gradle file.
[        ] * Try:
[        ] Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
[        ] * Get more help at https://help.gradle.org
[        ] BUILD FAILED in 1s
[ +348 ms] Running Gradle task 'assembleRelease'... (completed in 1.7s)
[   +7 ms] "flutter apk" took 2,296ms.
Gradle task assembleRelease failed with exit code 1

Temporary fix:

googleServices { disableVersionCheck = false } 

Hypertrack is preventing FCM notification

Bug report

Describe the bug
I am using hypertrack_plugin (https://pub.dev/packages/hypertrack_plugin) which presumably uses FCM under the hood for its functioning. However using it alongside the firebase_messaging plugin, I am unable to get any message in callback onMessage() whenever the app is in the foreground. When I remove hypetrack_plugin from my project, it works fine.

Steps to reproduce

Steps to reproduce the behavior:

  1. Add hypertrack_plugin and firebase_messaging in the project dependency.
  2. Follow necessary steps to setup HyperTrack from the link given above.
  3. Also, do necessary steps to setup firebase_messaging.
  4. Implement a callback in following way:-
_firebaseMessaging.configure(
      onMessage: (Map<String, dynamic> message) async {
        print('on message $message');
        // not called when app is in foreground when hypertrack_plugin is added to the project
      },
      onResume: (Map<String, dynamic> message) async {
        print('on resume $message');
        // called when app is launched from background state from the notification tap. This works as expected.
      },
      onLaunch: (Map<String, dynamic> message) async {
        print('on launch $message');
        // called when app is launched from terminated state from the notification tap. This works as expected.
      },
    );

REST API used to invoke callbacks

curl --location --request POST 'https://fcm.googleapis.com/fcm/send' \
--header 'Content-Type: application/json' \
--header 'Authorization: key=<SERVER_KEY>' \
--data-raw '{
  "to": "<DEVICE_FCM_TOKEN>",
  "notification": {
    "title": "This is the title",
    "body": "Here is the body"
  },
  "data": {
    "click_action": "FLUTTER_NOTIFICATION_CLICK",
    "title": "This is the title",
    "body": "Here is the body",
    "some key": "some value",
    "another key": "another value"
  }
}'

Expected behavior

onMessage() should be called whenever the app is in the foreground.


Additional context

Add any other context about the problem here.


Flutter doctor

Run flutter doctor and paste the output below:

Click To Expand
[✓] Flutter (Channel stable, v1.17.5, on Mac OS X 10.15.4 19E287, locale en-NP)
 
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.1)
[✓] Xcode - develop for iOS and macOS (Xcode 11.3.1)
[✓] Android Studio (version 4.0)
[!] IntelliJ IDEA Ultimate Edition (version 2020.1.2)
    ✗ Flutter plugin not installed; this adds Flutter specific functionality.
    ✗ Dart plugin not installed; this adds Dart specific functionality.
[✓] Connected device (2 available)

! Doctor found issues in 1 category.

Flutter dependencies

Run flutter pub deps -- --style=compact and paste the output below:

Click To Expand
Dart SDK 2.8.4
Flutter SDK 1.17.5
chaincargo_courier 3.1.2+19

dependencies:
- connectivity 0.4.9+3 [flutter meta connectivity_platform_interface connectivity_macos connectivity_for_web]
- cupertino_icons 0.1.3
- device_info 0.4.2+8 [flutter device_info_platform_interface]
- dio 3.0.10 [http_parser path]
- firebase_core 0.5.0+1 [firebase_core_platform_interface flutter quiver meta firebase_core_web]
- firebase_messaging 7.0.3 [meta flutter firebase_core]
- firebase_remote_config 0.4.0+1 [flutter firebase_core]
- flushbar 1.10.4 [flutter]
- flutter 0.0.0 [collection meta typed_data vector_math sky_engine]
- flutter_localizations 0.0.0 [flutter intl collection meta path typed_data vector_math]
- flutter_svg 0.17.4 [path_drawing xml vector_math meta flutter]
- font_awesome_flutter 8.8.1 [flutter]
- hexcolor 1.0.4 [flutter]
- http 0.12.2 [http_parser path pedantic]
- image 2.1.12 [archive xml]
- intl 0.16.1 [path]
- intl_translation 0.17.9 [analyzer args dart_style intl path petitparser]
- package_info 0.4.3 [flutter]
- permission_handler 5.0.1+1 [flutter meta permission_handler_platform_interface]
- provider 3.2.0 [flutter]
- rxdart 0.20.0
- shared_preferences 0.5.12 [meta flutter shared_preferences_platform_interface shared_preferences_linux shared_preferences_macos shared_preferences_web shared_preferences_windows]
- url_launcher 5.7.2 [flutter url_launcher_platform_interface url_launcher_web url_launcher_linux url_launcher_macos url_launcher_windows]

dev dependencies:
- flutter_launcher_icons 0.6.1 [image dart_config]
- flutter_test 0.0.0 [flutter test_api path image quiver stack_trace vector_math archive args async boolean_selector charcode collection convert crypto matcher meta petitparser source_span stream_channel string_scanner term_glyph typed_data xml]

transitive dependencies:
- _fe_analyzer_shared 7.0.0 [meta]
- analyzer 0.39.17 [_fe_analyzer_shared args charcode cli_util collection convert crypto glob html meta package_config path pub_semver source_span watcher yaml]
- archive 2.0.13 [crypto args path]
- args 1.6.0
- async 2.4.1 [collection]
- boolean_selector 2.0.0 [source_span string_scanner]
- charcode 1.1.3
- cli_util 0.2.0 [path]
- collection 1.14.12
- connectivity_for_web 0.3.1+2 [connectivity_platform_interface flutter_web_plugins flutter]
- connectivity_macos 0.1.0+5 [flutter]
- connectivity_platform_interface 1.0.6 [flutter meta plugin_platform_interface]
- convert 2.1.1 [charcode typed_data]
- crypto 2.1.4 [collection convert typed_data]
- csslib 0.16.2 [source_span]
- dart_config 0.5.0 [yaml]
- dart_style 1.3.6 [analyzer args path source_span]
- device_info_platform_interface 1.0.1 [flutter meta plugin_platform_interface]
- ffi 0.1.3
- file 5.2.1 [intl meta path]
- firebase 7.3.0 [http http_parser js]
- firebase_core_platform_interface 2.0.0 [flutter meta plugin_platform_interface quiver]
- firebase_core_web 0.2.0 [firebase firebase_core_platform_interface flutter flutter_web_plugins meta js]
- flutter_web_plugins 0.0.0 [flutter collection meta typed_data vector_math]
- glob 1.2.0 [async collection node_io path pedantic string_scanner]
- html 0.14.0+3 [csslib source_span]
- http_parser 3.1.4 [charcode collection source_span string_scanner typed_data]
- js 0.6.2
- matcher 0.12.6 [stack_trace]
- meta 1.1.8
- node_interop 1.1.1 [js]
- node_io 1.1.1 [node_interop path]
- package_config 1.9.3 [path charcode]
- path 1.6.4
- path_drawing 0.4.1+1 [vector_math meta path_parsing flutter]
- path_parsing 0.1.4 [vector_math meta]
- path_provider_linux 0.0.1+2 [path xdg_directories path_provider_platform_interface flutter]
- path_provider_platform_interface 1.0.3 [flutter meta platform plugin_platform_interface]
- path_provider_windows 0.0.4+1 [path_provider_platform_interface meta path flutter ffi win32]
- pedantic 1.9.0
- permission_handler_platform_interface 2.0.1 [flutter meta plugin_platform_interface]
- petitparser 2.4.0 [meta]
- platform 2.2.1
- plugin_platform_interface 1.0.3 [meta]
- process 3.0.13 [file intl meta path platform]
- pub_semver 1.4.4 [collection]
- quiver 2.1.3 [matcher meta]
- shared_preferences_linux 0.0.2+2 [file flutter meta path path_provider_linux shared_preferences_platform_interface]
- shared_preferences_macos 0.0.1+10 [shared_preferences_platform_interface flutter]
- shared_preferences_platform_interface 1.0.4 [meta flutter]
- shared_preferences_web 0.1.2+7 [shared_preferences_platform_interface flutter flutter_web_plugins meta]
- shared_preferences_windows 0.0.1+1 [shared_preferences_platform_interface flutter ffi file meta path path_provider_platform_interface path_provider_windows]
- sky_engine 0.0.99
- source_span 1.7.0 [charcode collection meta path term_glyph]
- stack_trace 1.9.3 [path]
- stream_channel 2.0.0 [async]
- string_scanner 1.0.5 [charcode meta source_span]
- term_glyph 1.1.0
- test_api 0.2.15 [async boolean_selector collection meta path source_span stack_trace stream_channel string_scanner term_glyph matcher]
- typed_data 1.1.6
- url_launcher_linux 0.0.1+1 [flutter]
- url_launcher_macos 0.0.1+8 [flutter]
- url_launcher_platform_interface 1.0.8 [flutter meta plugin_platform_interface]
- url_launcher_web 0.1.4+1 [url_launcher_platform_interface flutter flutter_web_plugins meta]
- url_launcher_windows 0.0.1+1 [flutter]
- vector_math 2.0.8
- watcher 0.9.7+15 [async path pedantic]
- win32 1.7.3 [ffi]
- xdg_directories 0.1.0 [path process flutter]
- xml 3.6.1 [collection convert meta petitparser]
- yaml 2.2.1 [charcode collection string_scanner source_span]

Crash

The app simply crashes when started and pressed on start tracking button ,( publishable key is inserted correctly)

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.