mojio / mojio-ios-sdk Goto Github PK
View Code? Open in Web Editor NEWAn ios client to the Mojio API
License: MIT License
An ios client to the Mojio API
License: MIT License
Hey!
Adding
pod 'MojioSDK
to project's Podfile
and running pod install
results in cocoapods install failing on:
[!] Unable to find a specification for `MojioSDK`
Using
pod 'MojioSDK', :git => "https://github.com/mojio/mojio-ios-sdk.git"
gently solves this issue.
It might be a good idea to update this part of readme.
Thanx!
Current implementation of the SDK stores token in NSUserDefaults.
Since MojioAccessToken is something that grants you access to whole range of sensitive user information, it should be probably stored in Keychain as it is the recommended place where to store such information.
In develop branch the AuthClient class does not show methods having Custom classes like method having AuthToken as parameters.
Solution:
Please inherit that class(AuthToken) from NSObject and use override key for the init method.That will show all methods of AuthClient in "MojioSDK-Swift.h"
This particular function in MojioClient erases everything stored in NSUserDefaults:
- (void)logoutWithCompletionBlock:(void (^)(void))completionBlock {
[[self.manager requestSerializer] setValue:nil forHTTPHeaderField:@"MojioAPIToken"];
// remove all objects from the NSUserDefaults
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
NSDictionary *defaultsDict = [defaults dictionaryRepresentation];
for (id key in defaultsDict) {
[defaults removeObjectForKey:key];
}
[defaults synchronize];
if (completionBlock) {
completionBlock();
}
}
This is not wise. You should probably only erase values stored by your SDK. Current implementation erases any other possible values stored by other parties.
Many iOS projects these days are making use of Carthage for dependencies instead of CocoaPods. Currently the MojioSDK requires you to use CocoaPods to install its dependencies which breaks the ability to use MojioSDK as a Carthage dependency.
There are two ways to solve this.
Both options still allow MojioSDK to function and install as a CocoaPod. The only change is how you develop on MojioSDK.
Option 2 replaces pod install
inside the mojio-ios-sdk
project you with carthage update
. You would not need to use the .xcworkspace
anymore.
Option 1 has no build step as the frameworks are already bundled.
I'll be pushing a PR for the swift4
branch that makes the changes necessary for option 2. I think this is a big benefit for the MojioSDK and does not impact development on the sdk severely. Please leave any feedback on how I can improve this as I'd like to see it merged in.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.