function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Gauri Kasat 8Gauri Kasat 8 

how to get location whenever salesforce1 app comes to active state?

Hello,
If at any point of time the App status becomes from Inactive to Active the salesforce1 app should capture location.
So, How can we determine in vf page that the salesforce1 app has become active?
Todd Halfpenny MCTodd Halfpenny MC
Hi Gauri,

What you're after is an onResume event, though I don't think the Salesforce Mobile app (formerly known as Salesforce1) has any hooks in (or at least one that's are exposed up the stack).

The onResume/resume events are available if you create your own custom mobile application, so if your business need is great then this might be the only route for you at the moment. If you're interested in that then you can check out the great trailhead modules on the Salesforce Mobile SDK. Be aware though that going down the custom app route isn't something to be taken on lightly as there is a lot to take care of  (authing, OS updates, store submissions, SDK updates, Salesforce updates, etc), though there are solutions that will take care of these other areas for you, such as MobileCaddy (https://mobilecaddy.net) (who I work for)
Gauri Kasat 8Gauri Kasat 8

Hey Todd,

Thankyou for your response but onResume didn't work for me. 

Todd Halfpenny MCTodd Halfpenny MC
Ah yes, I wouldn't expect it to, perhaps you mised this in my reply "though I don't think the Salesforce Mobile app (formerly known as Salesforce1) has any hooks in (or at least one that's are exposed up the stack)."

I was trying to say that to acheive what you want you need to use these events, and these hooks are available at a lower level, and could be used if you were building a custom app.
Gauri Kasat 8Gauri Kasat 8
If there is any other solution.. do tell me...
Todd Halfpenny MCTodd Halfpenny MC

I don't believe there is, at present.

Like I say, if your business need warrants it then the custom app route will enable this behaviour.