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

Open appropriate Dexcom app #20

Closed
channemann opened this issue Jun 6, 2016 · 8 comments
Closed

Open appropriate Dexcom app #20

channemann opened this issue Jun 6, 2016 · 8 comments
Milestone

Comments

@channemann
Copy link
Collaborator

Currently, a single tap on the status screen's glucose chart opens the Dexcom G5 app. If the user is instead using a G4, is would to preferable to open the G4 app (Share 2).

@loudnate
Copy link
Collaborator

loudnate commented Jun 6, 2016

Do you know what the URL scheme is to open the G4 app?

On Jun 6, 2016, at 10:36 AM, Chris Hannemann notifications@github.com wrote:

Currently, a single tap on the status screen's glucose chart opens the Dexcom G5 app. If the user is instead using a G4, is would to preferable to open the G4 app (Share 2).


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.

@channemann
Copy link
Collaborator Author

I do not; is this something you can only find by examining the source code,
or is it publicly exposed?

On Mon, Jun 6, 2016 at 11:25 AM, Nathan Racklyeft notifications@github.com
wrote:

Do you know what the URL scheme is to open the G4 app?

On Jun 6, 2016, at 10:36 AM, Chris Hannemann notifications@github.com
wrote:

Currently, a single tap on the status screen's glucose chart opens the
Dexcom G5 app. If the user is instead using a G4, is would to preferable to
open the G4 app (Share 2).


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#20 (comment), or mute
the thread
https://github.com/notifications/unsubscribe/AFI0iDqkzh7u-PWrEmci5TuOKSqJ39Dnks5qJGYJgaJpZM4IvImH
.

Chris Hannemann
chris.hannemann@gmail.com

@loudnate
Copy link
Collaborator

loudnate commented Jun 6, 2016

It's available in the plist file in the encrypted binary package downloaded by iTunes. Find the ipa file in finder, rename it to .zip, and uncompress it. Find the bundle in the Payload directory, and open it using the "Show Package Contents" context menu option. Inside there should be a file called Info.plist, and any supported URL schemes are under the CFBundleURLSchemes key.

On Jun 6, 2016, at 11:38 AM, Chris Hannemann notifications@github.com wrote:

I do not; is this something you can only find by examining the source code,
or is it publicly exposed?

On Mon, Jun 6, 2016 at 11:25 AM, Nathan Racklyeft notifications@github.com
wrote:

Do you know what the URL scheme is to open the G4 app?

On Jun 6, 2016, at 10:36 AM, Chris Hannemann notifications@github.com
wrote:

Currently, a single tap on the status screen's glucose chart opens the
Dexcom G5 app. If the user is instead using a G4, is would to preferable to
open the G4 app (Share 2).


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#20 (comment), or mute
the thread
https://github.com/notifications/unsubscribe/AFI0iDqkzh7u-PWrEmci5TuOKSqJ39Dnks5qJGYJgaJpZM4IvImH
.

Chris Hannemann
chris.hannemann@gmail.com

You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.

@channemann
Copy link
Collaborator Author

channemann commented Jun 6, 2016

I don't see the CFBundleURLSchemes key, but under URL types > Item 0, there is URL identifier of com.dexcom.Share2. Is that what is needed?

@loudnate
Copy link
Collaborator

loudnate commented Jun 6, 2016

It's there: dexcomshare

@loudnate
Copy link
Collaborator

loudnate commented Jun 6, 2016

Would you be interested in making this change? You can copy the logic that already exists and add an else if condition. You'll also need to add the scheme to the LSApplicationQueriesSchemes array in Loop's Info.plist.

@channemann
Copy link
Collaborator Author

I can give it a shot. Am I right that the conditional would be here:

https://github.com/loudnate/Loop/blob/master/Loop/View%20Controllers/StatusTableViewController.swift#L561

In which case, how do I determine whether the user has a G4 or G5? I actually have both apps on my phone, so it successfully goes to the G5 apps even though I have no reason to be there right now.

@loudnate
Copy link
Collaborator

loudnate commented Jun 7, 2016

well then I'd suggest you delete the G5 app from your phone if you're not using it 😄
I'd rather keep the logic simple rather than digging in the device configuration from the status screen and say:

IF (G5 app installed) THEN open(G5 app)
ELSE IF (G4 app installed) THEN open(G4 app)

You can use the canOpenURL method in each if condition:

if let URL = NSURL(string: "dexcomcgm://") where UIApplication.sharedApplication().canOpenURL(URL)

@loudnate loudnate added this to the 0.3.0 milestone Jun 9, 2016
lgruen pushed a commit to lgruen/Loop that referenced this issue Aug 8, 2018
Merge latest changes into IRC branch
erikdi pushed a commit to erikdi/Loop that referenced this issue Feb 10, 2019
Filter the services array to just the CGM service
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants