Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-20356

Android Marshmallow is not showing geolocation request alert

    Details

    • Type: Bug
    • Status: Closed
    • Priority: High
    • Resolution: Invalid
    • Affects Version/s: Release 5.1.2, Release 5.1.1
    • Fix Version/s: None
    • Component/s: None
    • Environment:

      Android Marshmallow
      SDK 5.1.2

      Description

      Issue Description

      Trying to get user location on a device with Marshmallow on Android, the Marshmallow OS should show the geolocation request as described as follows - http://developer.android.com/training/permissions/requesting.html

      Steps to Replicate
      1. Create a new classic mobile default project
      2. Paste the next code:

        // this sets the background color of the master UIView (when there are no windows/tab groups on it)
        Titanium.UI.setBackgroundColor('#000');
         
        var win = Titanium.UI.createWindow({  
            title:'Geolocation on Marshallow',
            backgroundColor:'#fff'
        });
         
        var label = Titanium.UI.createLabel({
        	color: '#000',
        	text: 'Tap Me',
        	textAlign: 'center',
        	left: 0,
        	top: 0,
        	width: Ti.UI.FILL,
        	height: Ti.UI.FILL
        });
         
        Titanium.Geolocation.purpose = 'Get Current Location';
         
        label.addEventListener('click', function (event) {
        	Ti.API.error('Calling Ti.Geolocation.getCurrentPosition');
        	if (Ti.Geolocation.locationServicesEnabled) {
        		Ti.Geolocation.getCurrentPosition(function (event) {
        			Ti.API.error('Ti.Geolocation.getCurrentPosition Callback Success: ' + event.success);
        			/*
        	    	Ti.UI.createAlertDialog({                                                                                                                                                                                                                                
        	      		title: 'Geolocation',
        	      		message: 'Success: ' + event.success,
        	      		ok: 'OK'
        	    	}).show();
        	    	*/
        	    	
        			if (event.error) {
        	            Ti.API.error('Error: ' + event.error);
        	        } else {
        	            Ti.API.info(event.coords);
        	        }
        	    });    
        	}else{
        		alert("location services not enabled");
        	}    
        });
         
        win.add(label);
        win.open();
        
        

      3. Run on Android Marshmallow device
      4. Marshmallow geolocation request OS should work as described here: http://developer.android.com/training/permissions/requesting.html

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                emerriman Eric Merriman
                Reporter:
                rramirez Ricardo Ramirez
              • Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

                  • Titanium SDK/CLI <> Titanium Mobile
                    Synced with:
                    TIMOB-20919
                    Sync status:
                    ERROR
                    Last received:
                    Last sent:

                    Git Integration