Dropbox Core API for Swift:Cannot initialize DBSession? - ios

I was following the link below in order to use the Dropbox Core API in my iOS application: https://www.dropbox.com/developers/core/start/ios
However, this is all written in Objective C. I have gotten it so that I have imported the DropboxSDK into my project but I can't seem to find the Swift equivalent code of beginning the authorization process. I have tried looking at all of the given functions in DBSession and DBSessionDelegate that look similar to those in the example tutorial above but I haven't had any luck. Any ideas how to do this? The following is the code in Objective C that I am trying to translate into Swift.
DBSession *dbSession = [[DBSession alloc]
initWithAppKey:#"INSERT_APP_KEY"
appSecret:#"INSERT_APP_SECRET"
root:INSERT_ACCESS_TYPE]; // either kDBRootAppFolder or kDBRootDropbox
[DBSession setSharedSession:dbSession];
Specifically, I can't seem to find any function to allow me to initialize my application key app secret, or root. If anyone could help me out, that'd be great! Thanks.

let session = DBSession(appKey:"...", appSecret:"...", root:...); works in my testing.
You may want to read https://www.dropbox.com/developers/blog/109/swift-apps-with-dropbox for the basics of using Dropbox SDKs in Swift. (That blog post doesn't deal specifically with the Core SDK, but the steps there still apply.)

Related

How to get collection from Shopify SDK?

I am Work With Shopify SDK. I Succesfully integrated it but the problem is when I have try to get collection from shopify then my app is crashed?
I have follow this tutorial which provided by shopify.
Code
// Shopify Initializtion
BUYClient *client;
client = [[BUYClient alloc] initWithShopDomain:SHOP_DOMAIN
apiKey:API_KEY
appId:APP_ID];
[client getCollectionsPage:1 completion:^(NSArray<BUYCollection *> * collections, NSUInteger page, BOOL reachedEnd, NSError *error)
{
// here get a collection
}];
Crash
Please help me to short out this.
Good news for you is I solved this earlier this week! You are probably using their static framework which has some issues presently (I think they will update their docs to reflect this).
Here was the answer I wrote on their GitHub issues board:
This stack-overflow answer ended up being the solution:
https://stackoverflow.com/a/29453132 I had to take the "Mobile Buy
SDK.xcdatamodel" from the Mobile Buy SDK project, and put it into my
project (plus make sure it is in compile sources!). After this, my
project works with the static framework.

what is the iOS equivalent of mixpanel.get_property() in javascript

I am trying to increment a super property in mixpanel iOS (OBJC). I am following this blog to do so:
https://blog.mixpanel.com/2015/01/29/incremental-super-properties/
As you can see, it does what I want in javascript using get_property method of mixpanel. But I need to do the same thing on iOS. I can't seem to figure out what is the equivalent of mixpanel.get_property() on iOS.
https://mixpanel.github.io/mixpanel-iphone/Classes/Mixpanel/index.html#//apple_ref/occ/instm/Mixpanel/currentSuperProperties
The above link is equivalent to
https://mixpanel.com/help/reference/javascript-full-api-reference#mixpanel.get_property
Both functions return super properties
Hope this helps,
Cheers Analytics ML.

Quicblox migration issue, No QBVideoChat class available

I am getting this response in the log.
There is no delegates which responds to didReceiveNewSession:userInfo:
I wonder If this points to specific delegate as I am not able to find any relative solution for this.
Also Previously there was a class QBVideoChat which is not mentioned on Quickblox blog or updation guide.
I wonder if that has any thing to do with this issue.
Thanks in advance
QuickBlox has deprecated old QBVideoChat with WebRTC QuickBloxWebRTC
http://quickblox.com/developers/Sample-webrtc-ios
Here is the open source sample-video-chat project available on github
https://github.com/QuickBlox/quickblox-ios-sdk/tree/master/sample-videochat-webrtc
Error There is no delegates which responds to didReceiveNewSession:userInfo: means that you did not add any class to QBRTCClient delegates list

RestKit: RKClient not recognized by Xcode project

I am using/implementing RestKit into my project at the moment, and I've followed the github wiki to install everything correctly. Everything is there and working properly. The application builds and runs great. I'm just trying to make a HTTP GET request now by first setting up the RKClient, but my project doesn't seem to recognize RKClient even though I've imported the <RestKit/Restkit.h> file in the header of the file.
I'm beginning to think that the RKClient class is deprecated or something because every other class seems to be there as expected.
I've tried looking everywhere and really ensuring that I've followed the instructions to setup RestKit properly, and yet I'm still stuck on the first line!! (Initializing the RKClient).
Another possibility is that I'm doing this all wrong. I just implemented the library, so I'm just playing around with it. But if I'm not doing a HTTP GET request the right way, please guide me the right direction.
Thanks!!
From RestKit 0.20.x onwards RKClient is not part of RestKit. You can use HTTP Client like :
[RKObjectManager myObjManager].HTTPClient
See This Link

Google oAuth example

I'm looking for a worked example of how to call into Googles oAuth service with a view to simply uploading a txt file. On googles docs I have the followed the example
http://code.google.com/p/google-api-java-client/wiki/OAuth2
but it won't compile .... CalendarScopes.CALENDAR is the problem and I can't see what Jar contains this class. I imported every Jar in the google-oauth-java-client-1.12.0-beta download (Also every jar in google-api-java-client-1.12.0-beta ) I dobn't understand the diff between these but that is for another day.
Any pointers would be welcome.
CalendarScopes.CALENDAR that you mentioned is not a part of a jar file but a scope for Calendar API provided by Google. For a sample to show how to implement that, here is one.
In the meanwhile, I would also suggest going over the following links to develop an understanding of the OAuth and how to use it with the different APIs.
OAuth Playground - This is very helpful when trying to learn about different API and permissions relating to those.
OpenID Connect Official Documentation
Hope this helps.

Resources