This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

ConnectIQ.bundle file missing from IOS SDK

Former Member
Former Member

Hi, 

    I am trying to follow the instructions to add the Garmin IOS SDK to my app.

https://developer.garmin.com/connect-iq/programmers-guide/ios-sdk-guide/

Can't do step 2 as the ConnectIQ.bundle file doesn't exist in the IOS SDK?

as far as I can see.

searched for a .bundle file using finder and using the find command in terminal, didn't find it  (find ./ -iname "*.bundle" -print)

Opened Example app using Xcode and saw ConnectIQ.bundle in the Supporting files group in the project navigator.

I Copied this ConnecIQ.bundle within Xcode to my project. Looked ok until you tried to build it.

Got file not found an error, it was referencing the ios SDK directory where there was no .bundle file.

Can anyone help

Regards,

                Daniel Leahy.

  • Former Member
    0 Former Member over 5 years ago

    Check out https://forums.garmin.com/developer/connect-iq/f/q-a/176033/ios-sdk-connectiq-bundle-file-missing

    Same question.  I looked throughout the SDK download.  Interestingly, it is included in the example app (which builds).  However, when I try to copy the bundle from the example app, it has an invalid reference.  Perhaps it has been eliminated.  Build succeeds with no bundle but the app exceptions.  Ummmm.

  • Former Member
    0 Former Member over 5 years ago in reply to Former Member

    Hi, the documentation on line is different from what is included in the SDK download.

    There is no .bundle file in the SDK, you are correct in saying its in the example app, i think that is because that app was done with an older version of the SDK, that would be my guess.

    If you follow the instructions in the SDK documention and embed the framework you should be fine.

    Be aware the Garmin ConnectIQ.framework is written in objective -C.

    You need what's called a bridging header to use an objective c framework in Swift.

    My bridging header contents

    #ifndef runAId_BridgingHeader_Swift_h

    #define runAId_BridgingHeader_Swift_h

    // Garmin SDK written in Objective-C, using bridging header to use its functionality in Swift

    #import <ConnectIQ/ConnectIQ.h>

    #import <ConnectIQ/IQApp.h>

    #import <ConnectIQ/IQAppStatus.h>

    #import <ConnectIQ/IQConstants.h>

    #import <ConnectIQ/IQDevice.h>

    #endif /* runAId_BridgingHeader_Swift_h */

    If you using Swift and you want an instance of the ConnectIQ class you can use something like 

    // MARK: GARMIN SDK init

            self.connectiq = ConnectIQ.sharedInstance()

    connectiq?.initialize(withUrlScheme: "your own schema goes here", uiOverrideDelegate: nil)

    Unfortunately, I am stuck after that.

    Next step is to use 

    connectiq?.showDeviceSelection()

    to get the user to select the connected garmin device using the Garmin Connect Mobile app, 

    For me I am getting the default dialog

    'Garmin Connect Mobile required, but it's not currently installed' 

    I have the GCM app installed and yet I still get the dialog above so the callback with the list of connected devices is never returned to my app.

    I am using Swift 4, XCode 10 (now 11.0)

    If you get it working let me know.

    Regards,

                    Daniel Leahy.

  • Former Member
    0 Former Member over 5 years ago in reply to Former Member

    To get past the dialog saying the GCM app is not installed,

    Use 

    If you are compiling against the iOS 9 SDK or above you will need to add an entry for gcm-ciq to LSApplicationQueriesSchemes in your app’s Info.plist. This is needed to ensure that the SDK can verify if GCM is installed. If this key is not present in your Info.plist it will need to be added.

    This is in the documentation in the SDK download but not in the online version as of 25th Sept 2019.

  • Former Member
    0 Former Member over 5 years ago in reply to Former Member

    Appreciate the note, Daniel.  I've made good progress but still in mid-stream.  I can provide details later if it'd be helpful.

    I'm running Swift 5, Xcode 10.3 & Garmin SDK 1.3. 

    In a pure Swift app, I was unable to get the return call from GCM after showDeviceSelection.  However, didn't see "GCM required..." dialog, just nothing.  

    I lacked confidence after all the shenanigans getting the build to work so I started a new project.  Walked carefully through all the steps (documented & undocumented).  I also decided to create an old ObjC single view app, then fold in a Swift class to support the bulk of the ConnectIQ interfaces.  We'll ultimately incorporate the Garmin interface in a legacy ObjC app so this better matches the ultimate target.

    The ObjC app invokes the Swift class to init ConnectIQ then perform the showDeviceSelection.  The ObjC UI wrapper has the OpenURL call back which does get invoked!  After the GCM app pops to the foreground, it then quickly brings up my test app (again).  Wow, that was way harder than it seems like it should be.  ;}

    However, as I rolled the rest of the Swift Comm class shortly (e.g. send messages, listen for status changes, etc.) I found the status change listener is never triggered & the "device" object rcv'd from GCM returned a status of "invalid device".

    Ugh!  I'm trying an ObjC only app to see if I can get the full monty working.  Maybe Swift isn't a good idea with so much erosion of original functionality?

    Thanks, Matthew