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

chore(android): remove deprecated Geolocation properties #10547

Merged
merged 6 commits into from Dec 19, 2018

Conversation

garymathews
Copy link
Contributor

@garymathews garymathews commented Dec 18, 2018

  • Remove deprecated Geolocation constants
TEST CASE
  • Test WITH and WITHOUT ti.playservices in tiapp.xml
var win = Ti.UI.createWindow({ backgroundColor: 'gray' }),
    listView = Ti.UI.createListView(),
    count = 1;

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

function push (e) {
    var section = Ti.UI.createListSection({ headerTitle: '#' + count++ });
    if (e.success) {
        if (e.coords) {
            e = e.coords;
        }
        section.setItems([
            { properties: { title: 'LOCATION:\n' + e.latitude + ', ' + e.longitude, color: 'orange' } },
            { properties: { title: 'ALTITUDE:\n' + e.altitude, color: 'orange' } },
            { properties: { title: 'ACCURACY:\n' + e.accuracy, color: 'orange' } }
        ]);
    } else {
        section.setItems([
            { properties: { title: 'ERROR:\n' + e.error, color: 'red' } }
        ]);
    }
    listView.appendSection(section);
}

function getLocation() {
    Ti.Geolocation.addEventListener('location', push);
    Ti.Geolocation.getCurrentPosition(push);
}

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.add(listView);
win.open();

JIRA Ticket

@garymathews garymathews added this to the 8.0.0 milestone Dec 18, 2018
@build build requested a review from a team December 18, 2018 22:12
@build
Copy link
Contributor

build commented Dec 18, 2018

Messages
📖

💾 Here's the generated SDK zipfile.

📖

✅ All tests are passing
Nice one! All 2890 tests are passing.

Generated by 🚫 dangerJS

Copy link
Contributor

@jquick-axway jquick-axway left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CR: Pass

@longton95 longton95 self-requested a review December 19, 2018 15:00
Copy link
Contributor

@longton95 longton95 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FR Passed

Tested using the testcase above and modified version, geolocation is recorded successfully with and without ti.playservices

ENV

OnePlus 6t (9.0)
APPC CLI: 7.0.9-3
MacOS: 10.14.2
Node.js Version: 8.12.0
Xcode 10.1

@longton95 longton95 merged commit 9bcd365 into tidev:master Dec 19, 2018
Brianggalvez pushed a commit to Brianggalvez/titanium_mobile that referenced this pull request Dec 31, 2018
* source/master: (1616 commits)
  [TIMOB-26537] Android: Module "AndroidManifest.xml" <uses> elements overwrites "tiapp.xml" elements (tidev#10467)
  fix(ios): test for refresh control usage (tidev#10550)
  fix: standardize os.arch values to Node.js equivalents
  feat(api): add node-compatible os core module
  docs: add totalMemory(), cpus() and uptime to Ti.Platform
  feat(ios): add totalMemory() method and uptime property to Ti.Platform
  feat(android): add totalMemory() method, cpus() method and uptime property to Ti.Platform
  chore(android): remove deprecated Geolocation properties (tidev#10547)
  fix(ios): Set transitionIsAnimating while pushing the controller rather waiting for delegate (tidev#10535)
  fix(ios) : Convert property ‘value’ to string inside hasText function (tidev#10521)
  fix(ios): Added missing flag to code sign TitaniumKit so device builds work again. (tidev#10505)
  [TIMOB-26585] Android: Catch all TCP socket read and write exceptions (tidev#10490)
  [TIMOB-26095] iOS 12: Replace UIWebView API in favor of WKWebView (tidev#10169)
  chore: update node-titanium-sdk (tidev#10548)
  fix(android): Fix for splashscreen activity with translucent status bar. (tidev#10536)
  core(deps): Add danger-plugin-dependencies
  chore: migrate latest tests to suite
  chore(package): update lockfile package-lock.json
  chore(package): update @seadub/danger-plugin-junit to version 0.0.2
  test: migrate tests to common suite
  ...

# Conflicts:
#	apidoc/Titanium/UI/ListView.yml
#	iphone/Classes/TiUIListView.h
#	iphone/Classes/TiUIListView.m
#	iphone/Classes/TiUIListViewProxy.m
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

5 participants