Remote Database API with XCode

HI All,

I have recently discovered Dream Factory and am working my way through the various tutorials / screen casts etc. I have one question that I can’t seem to find an answer to though.

I want my iOS app to connect to one of MS SQL server databases. So I have created a service in admin and I can test this out in the API Docs section - everything works fine. My question is how do I use this service in my iOS app. I tested retrieving data using the SWGDbApi which connects fine to DreamFactory databases but Im not sure which api to use to connect to a remote database. Can anyone point me in the right direction?

Many thanks

1 Like

Have you looked at the iOS SDK https://github.com/dreamfactorysoftware/dsp-core/wiki/iOS-SDK

The example given uses an object SWGDbApi which is hard coded in the SDK to use the default local DB provided by DSP.

But which API would you use instead to connect to Remote SQL Server database service rather than the local DB service?

1 Like

I’ve just found another article which mentions the SWGDbApi is to be used as a template which needs to manually updated for use with your own Remote SQL Service.

Is this understanding correct or I have got the wrong end of the stick… (really hope this is the wrong end of the stick!)

hey @wembly, the person working on the iOS SDK should post soon. I’ll ping him.

Thanks Ben any clarification which can be provided by Dream Factory on the expected way forward regarding custom services and the native SDKs will be very much appreciated.

Cheers
Wembly

@wembly Please take a look at https://github.com/dreamfactorysoftware/platform-sdk-for-ios this is updated version of iOS sdk with functions to pass api name. Api functions on this sdk returns raw json string as response. There are few other changes that you’ll observe,

Feel free to post if you get into any issues.

-Thanks

Thanks alokt for your update - much appreciated. We’ll have a play with the updated sdk and feedback our findings. Thanks!

@wembly, do let us know your candid feedback. we’re trying to improve the iOS SDK and make it as easy to use as possible. the SDK alok just linked above will soon replace the previous SDK i refer to above in the thread.

likewise @paulchatwin, please take a look at https://github.com/dreamfactorysoftware/platform-sdk-for-ios

Don’t worry we will :slight_smile: thanks again guys!

Sorry but one other point I need to ask - is there a corresponding Android beta version of this new sdk?

We are looking at releasing a iOS and Android app which will utilise a remote SQL database.

Thanks Wembly

Yes, there’s also an Android version that Alok is working on right now. It’ll be checked in shortly, looking at next week I believe. Both the new iOS and Android SDKs use unirest.io.

We’ll be updating the rest of the SDKs too and adding some new ones, like Swift.

I moved 2 posts to an existing topic: Connect to database from Xcode (iOS Ipad APP)