- Add Facebook SDK

- Add PNUser Login
This commit is contained in:
giuseppenuc committed 2016-02-12 00:01:51 +01:00
1 parent f2885301b9
commit a6dcf672bb
370 files changed
+44655 -2705

No files matched your search

+41
View File
@@ -41,6 +41,27 @@
<key>NSThirdPartyExceptionRequiresForwardSecrecy</key>
<true/>
</dict>
<key>facebook.com</key>
<dict>
<key>NSIncludesSubdomains</key>
<true/>
<key>NSThirdPartyExceptionRequiresForwardSecrecy</key>
<false/>
</dict>
<key>fbcdn.net</key>
<dict>
<key>NSIncludesSubdomains</key>
<true/>
<key>NSThirdPartyExceptionRequiresForwardSecrecy</key>
<false/>
</dict>
<key>akamaihd.net</key>
<dict>
<key>NSIncludesSubdomains</key>
<true/>
<key>NSThirdPartyExceptionRequiresForwardSecrecy</key>
<false/>
</dict>
</dict>
</dict>
<key>UIRequiredDeviceCapabilities</key>
@@ -63,5 +84,25 @@
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLSchemes</key>
<array>
<string>fb213761522305123</string>
</array>
</dict>
</array>
<key>FacebookAppID</key>
<string>213761522305123</string>
<key>FacebookDisplayName</key>
<string>PNObject</string>
<key>LSApplicationQueriesSchemes</key>
<array>
<string>fbapi</string>
<string>fb-messenger-api</string>
<string>fbauth2</string>
<string>fbshareextension</string>
</array>
</dict>
</plist>
+20 -3
View File
@@ -14,12 +14,20 @@
#import "PNAddress.h"
#import "PNObject+PNObjectConnection.h"
#import <FBSDKCoreKit/FBSDKCoreKit.h>
#import <FBSDKLoginKit/FBSDKLoginKit.h>
#import <FBSDKShareKit/FBSDKShareKit.h>
@implementation PNObjectAppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
[FBSDKSettings setAppID:@"213761522305123"];
[[FBSDKApplicationDelegate sharedInstance] application:application didFinishLaunchingWithOptions:launchOptions];
_window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
// Override point for customization after application launch.
@@ -61,9 +69,8 @@
// Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
}
- (void)applicationDidBecomeActive:(UIApplication *)application
{
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
- (void)applicationDidBecomeActive:(UIApplication *)application {
[FBSDKAppEvents activateApp];
}
- (void)applicationWillTerminate:(UIApplication *)application
@@ -71,4 +78,14 @@
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}
- (BOOL)application:(UIApplication *)application
openURL:(NSURL *)url
sourceApplication:(NSString *)sourceApplication
annotation:(id)annotation {
return [[FBSDKApplicationDelegate sharedInstance] application:application
openURL:url
sourceApplication:sourceApplication
annotation:annotation];
}
@end
+18 -6
View File
@@ -23,6 +23,7 @@
@property (nonatomic, strong) UIButton *cancelToken;
@end
@implementation PNObjectViewController
@@ -81,12 +82,10 @@
[_apiCall autoSetDimension:ALDimensionWidth toSize:140];
[_apiCall autoSetDimension:ALDimensionHeight toSize:44];
[_cancelToken autoAlignAxisToSuperviewAxis:ALAxisVertical];
[_cancelToken autoPinEdge:ALEdgeTop toEdge:ALEdgeBottom ofView:_refreshToken withOffset:35];
[_cancelToken autoSetDimension:ALDimensionWidth toSize:140];
[_cancelToken autoSetDimension:ALDimensionHeight toSize:44];
}
[super updateViewConstraints];
}
@@ -101,19 +100,32 @@
- (void) apiCallAction {
User *user = [User currentUser];
/*User *user = [User currentUser];
[user setFirstName:@"Giuseppe"];
[user setLastName:@"Nuficora"];
[user setEmail:@"giuseppe.nucifora@purplenetwork.it"];
[user setEmail:@"packman@giuseppenucifora.com"];
[user setPassword:@"asdasdasd"];
[user setConfirmPassword:@"asdasdasd"];
[user setHasAcceptedNewsletter:NO];
[user setHasAcceptedPrivacy:YES];
[user registerCurrentUserWithBlockSuccess:^(id _Nullable responseObject) {
[user saveLocally];
[user reloadFormServer];*/
/*[[User currentUser] socialLoginWithBlockSuccessFromViewController:self
blockSuccess:^(PNUser * _Nullable responseObject) {
} failure:^(NSError * _Nonnull error) {
}];*/
[[PNUser currentUser] loginCurrentUserWithEmail:@"packman@giuseppenucifora.com" password:@"asdasdasd" withBlockSuccess:^(PNUser * _Nullable responseObject) {
NSLog(@"response : %@",responseObject);
} failure:^(NSError * _Nonnull error) {
NSLog(@"response : %@",error);
}];
}