Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(android): add getLastLocation to FusedLocationProvider #13133

Merged
merged 4 commits into from Oct 7, 2022

Conversation

m1ga
Copy link
Contributor

@m1ga m1ga commented Oct 19, 2021

JIRA: https://jira.appcelerator.org/browse/TIMOB-26675

Optional Description:

Had this old ticket in my queue. Might fire the location event quicker.
Implementation from: https://developer.android.com/training/location/retrieve-current#java
Not sure how to test it 😄

example

var win = Titanium.UI.createWindow({
	layout: "vertical"
});

Ti.Geolocation.accuracy = Ti.Geolocation.ACCURACY_HIGH;

function getLocation() {
	Ti.Geolocation.addEventListener('location', function(e) {
		console.log(JSON.stringify(e, null, 2));
	});
}
win.addEventListener('open', function() {
	if (Ti.Geolocation.hasLocationPermissions()) {
		getLocation();
	} else {
		Ti.Geolocation.requestLocationPermissions(Ti.Geolocation.AUTHORIZATION_ALWAYS, function(e) {
			if (e.success) {
				getLocation();
			} else {
				alert('could not obtain location permissions');
			}
		});
	}
});

win.open();

@build build added this to the 10.2.0 milestone Oct 19, 2021
@build build requested a review from a team October 19, 2021 14:23
@build
Copy link
Contributor

build commented Oct 19, 2021

Fails
🚫

🔬 There are library changes, but no changes to the unit tests. That's OK as long as you're refactoring existing code, but will require an admin to merge this PR. Please see README.md#unit-tests for docs on unit testing.

Warnings
⚠️

Commit 2b6c71619d8462105d2d3b46b8c0cb9d09685a82 has a message "use existing method" giving 2 errors:

  • subject may not be empty
  • type may not be empty
⚠️ Tests have failed, see below for more information.
Messages
📖

🚨 This PR has one or more commits with warnings/errors for commit messages not matching our configuration. You may want to squash merge this PR and edit the message to match our conventions, or ask the original developer to modify their history.

📖 ❌ 1 tests have failed There are 1 tests failing and 1162 skipped out of 20782 total tests.
📖 🎉 Another contribution from our awesome community member, m1ga! Thanks again for helping us make Titanium SDK better. 👍
📖

💾 Here's the generated SDK zipfile.

Tests:

ClassnameNameTimeError
android.emulator.main.Titanium.Geolocation.methods#forwardGeocoder() works via callback argument (12)5.012
Error: expected false to be true
at Assertion.fail (/node_modules/should/cjs/should.js:275:13)
      at Assertion.value (/node_modules/should/cjs/should.js:356:9)
      at Geolocation.<anonymous> (/ti.geolocation.test.js:585:32)

Generated by 🚫 dangerJS against 2b6c716

@hansemannn hansemannn modified the milestones: 11.0.0, 11.1.0 May 27, 2022
@hansemannn hansemannn modified the milestones: 11.1.0, 12.0.0 Oct 7, 2022
@hansemannn hansemannn merged commit 0155e42 into tidev:master Oct 7, 2022
@m1ga m1ga deleted the fuseProvider branch December 10, 2022 17:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants