question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

iOS module implementation

See original GitHub issue

Hello guys, due to the pandemic I’ve some free time now. So I decided to learn a little bit of swift and try to implement my own geolocation module for iOS. I’ll be updating this thread as I implement features one by one. You can track the progress here.

https://github.com/Agontuk/react-native-geolocation-service/tree/next

If you have any suggestions, feel free to share here.

TODO

  • requestAuthorization
  • getCurrentPosition
  • startObserving
  • stopObserving
  • Background location update

API Changes

  • setRNConfiguration (deprecated) Currently it has two options skipPermissionRequests & authorizationLevel. Both of them will become unused because of the changes in requestAuthorization as described below.

  • async requestAuthorization(authorizationLevel) You must call this method with your desired permission level before requesting location, thus removing the necessity of skipPermissionRequests & authorizationLevel. Furthermore, this method now returns a promise which you can use to check the authorization status and take necessary actions.

    const status = await Geolocation.requestAuthorization("whenInUse"); // or "always"
    console.log(status); // "disabled", "granted", "denied", "restricted"
    
  • getCurrentPosition() Removed async keyword, since it’s not an async function. Also removed useSignificantChanges option cause it’s not needed for single location update.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:13
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

6reactions
Agontukcommented, May 8, 2020

iOS implementation is done, I’ll merge this into master soon. If anyone has any suggestion or faced any issue, let me know.

4reactions
Agontukcommented, Jun 2, 2020

No, react-native-geolocation dependency is removed in v5.0.0

Read more comments on GitHub >

github_iconTop Results From Across the Web

Implementing Bridging For iOS Native Modules
Implement bridging and create your own custom module for iOS through this read. ... We also implemented a custom native module in Android....
Read more >
Modular Architecture in iOS: Dependencies | by Leandro Pérez
Types of dependencies. Sharing fonts among modules and the app. Sharing images and asset catalogs. Working with Bundles and Storyboards. The ...
Read more >
iOS Native Modules
A native module is an Objective-C class that implements the RCTBridgeModule protocol. Next up, let's start implementing the native module.
Read more >
iOS Module Project - Titanium SDK
iOS Module Project. # Introduction. This guide covers how to manage your module project as well as how to add third-party frameworks and...
Read more >
Reducing iOS Build Times by using Interface Modules
While dividing an app into several modules can improve the build time of an iOS app, the result heavily depends on what is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found