Update Google+ integration.
[UPDATED] Google+ SDK to 1.1.0.
This commit is contained in:
@@ -18,8 +18,6 @@
|
||||
@property (strong, nonatomic) MPUserEntity *activeUser;
|
||||
@property (strong, nonatomic) MPKey *key;
|
||||
|
||||
+ (MPAppDelegate_Shared *)get;
|
||||
|
||||
- (MPUserEntity *)activeUserInContext:(NSManagedObjectContext *)moc;
|
||||
|
||||
@end
|
||||
|
||||
@@ -16,6 +16,4 @@
|
||||
@property (nonatomic, retain) NSNumber *iCloud;
|
||||
@property (nonatomic, retain) NSNumber *iCloudDecided;
|
||||
|
||||
+ (MPConfig *)get;
|
||||
|
||||
@end
|
||||
|
||||
@@ -23,8 +23,6 @@
|
||||
@property (nonatomic, weak) IBOutlet NSMenuItem *createUserItem;
|
||||
@property (nonatomic, weak) IBOutlet NSMenuItem *usersItem;
|
||||
|
||||
+ (MPAppDelegate *)get;
|
||||
|
||||
- (IBAction)activate:(id)sender;
|
||||
- (IBAction)togglePreference:(NSMenuItem *)sender;
|
||||
- (IBAction)newUser:(NSMenuItem *)sender;
|
||||
|
||||
@@ -12,6 +12,4 @@
|
||||
|
||||
@property (nonatomic, retain) NSString *usedUserName;
|
||||
|
||||
+ (MPMacConfig *)get;
|
||||
|
||||
@end
|
||||
|
||||
@@ -8,11 +8,13 @@
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import <MessageUI/MessageUI.h>
|
||||
|
||||
#import "MPAppDelegate_Shared.h"
|
||||
#import "GPPShare.h"
|
||||
|
||||
@interface MPAppDelegate : MPAppDelegate_Shared
|
||||
|
||||
+ (MPAppDelegate *)get;
|
||||
@property (nonatomic, readonly) GPPShare *googlePlus;
|
||||
|
||||
- (void)showGuide;
|
||||
- (void)showFeedbackWithLogs:(BOOL)logs forVC:(UIViewController *)viewController;
|
||||
|
||||
@@ -14,14 +14,7 @@
|
||||
|
||||
@interface MPAppDelegate ()
|
||||
|
||||
- (NSDictionary *)testFlightInfo;
|
||||
- (NSString *)testFlightToken;
|
||||
|
||||
- (NSDictionary *)crashlyticsInfo;
|
||||
- (NSString *)crashlyticsAPIKey;
|
||||
|
||||
- (NSDictionary *)localyticsInfo;
|
||||
- (NSString *)localyticsKey;
|
||||
@property (nonatomic, readwrite) GPPShare *googlePlus;
|
||||
|
||||
@end
|
||||
|
||||
@@ -38,11 +31,6 @@
|
||||
#endif
|
||||
}
|
||||
|
||||
+ (MPAppDelegate *)get {
|
||||
|
||||
return (MPAppDelegate *)[super get];
|
||||
}
|
||||
|
||||
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
|
||||
|
||||
[[[NSBundle mainBundle] mutableInfoDictionary] setObject:@"Master Password" forKey:@"CFBundleDisplayName"];
|
||||
@@ -83,6 +71,16 @@
|
||||
err(@"TestFlight: %@", exception);
|
||||
}
|
||||
#endif
|
||||
@try {
|
||||
NSString *googlePlusClientID = [self googlePlusClientID];
|
||||
if ([googlePlusClientID length]) {
|
||||
inf(@"Initializing Google+");
|
||||
self.googlePlus = [[GPPShare alloc] initWithClientID:googlePlusClientID];
|
||||
}
|
||||
}
|
||||
@catch (id exception) {
|
||||
err(@"Google+: %@", exception);
|
||||
}
|
||||
@try {
|
||||
NSString *crashlyticsAPIKey = [self crashlyticsAPIKey];
|
||||
if ([crashlyticsAPIKey length]) {
|
||||
@@ -280,6 +278,10 @@
|
||||
if (!url)
|
||||
return NO;
|
||||
|
||||
// Google+
|
||||
if ([self.googlePlus handleURL:url sourceApplication:sourceApplication annotation:annotation])
|
||||
return YES;
|
||||
|
||||
// Arbitrary URL to mpsites data.
|
||||
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
|
||||
NSError *error;
|
||||
@@ -658,8 +660,26 @@
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - TestFlight
|
||||
|
||||
#pragma mark - Google+
|
||||
|
||||
- (NSDictionary *)googlePlusInfo {
|
||||
|
||||
static NSDictionary *googlePlusInfo = nil;
|
||||
if (googlePlusInfo == nil)
|
||||
googlePlusInfo = [[NSDictionary alloc] initWithContentsOfURL:
|
||||
[[NSBundle mainBundle] URLForResource:@"Google+" withExtension:@"plist"]];
|
||||
|
||||
return googlePlusInfo;
|
||||
}
|
||||
|
||||
- (NSString *)googlePlusClientID {
|
||||
|
||||
return NSNullToNil([[self googlePlusInfo] valueForKeyPath:@"ClientID"]);
|
||||
}
|
||||
|
||||
|
||||
#pragma mark - TestFlight
|
||||
|
||||
- (NSDictionary *)testFlightInfo {
|
||||
|
||||
@@ -679,7 +699,6 @@
|
||||
|
||||
#pragma mark - Crashlytics
|
||||
|
||||
|
||||
- (NSDictionary *)crashlyticsInfo {
|
||||
|
||||
static NSDictionary *crashlyticsInfo = nil;
|
||||
@@ -698,7 +717,6 @@
|
||||
|
||||
#pragma mark - Localytics
|
||||
|
||||
|
||||
- (NSDictionary *)localyticsInfo {
|
||||
|
||||
static NSDictionary *localyticsInfo = nil;
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
|
||||
#import <QuartzCore/QuartzCore.h>
|
||||
#import <Social/Social.h>
|
||||
#import "GooglePlusShare.h"
|
||||
|
||||
#import "MPUnlockViewController.h"
|
||||
#import "MPAppDelegate.h"
|
||||
@@ -837,11 +836,9 @@
|
||||
|
||||
- (IBAction)google:(UIButton *)sender {
|
||||
|
||||
GooglePlusShare *share = [[GooglePlusShare alloc] initWithClientID:[[PearlInfoPlist get] objectForKeyPath:@"GooglePlusClientID"]];
|
||||
[[[[share shareDialog]
|
||||
setURLToShare:[NSURL URLWithString:@"http://masterpasswordapp.com"]]
|
||||
setPrefillText:@"I've secured my accounts with Master Password: Actually secure passwords that cannot get lost."]
|
||||
open];
|
||||
id<GPPShareBuilder> shareDialog = [[MPAppDelegate get].googlePlus shareDialog];
|
||||
[[[shareDialog setURLToShare:[NSURL URLWithString:@"http://masterpasswordapp.com"]]
|
||||
setPrefillText:@"I've started doing passwords properly thanks to Master Password for iOS."] open];
|
||||
}
|
||||
|
||||
- (IBAction)mail:(UIButton *)sender {
|
||||
|
||||
@@ -17,6 +17,4 @@
|
||||
@property (nonatomic, retain) NSNumber *typeTipShown;
|
||||
@property (nonatomic, retain) NSNumber *loginNameTipShown;
|
||||
|
||||
+ (MPiOSConfig *)get;
|
||||
|
||||
@end
|
||||
|
||||
@@ -63,16 +63,6 @@
|
||||
<string>????</string>
|
||||
<key>CFBundleURLTypes</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>CFBundleTypeRole</key>
|
||||
<string>Editor</string>
|
||||
<key>CFBundleURLName</key>
|
||||
<string>facebook</string>
|
||||
<key>CFBundleURLSchemes</key>
|
||||
<array>
|
||||
<string>fb257095917745237</string>
|
||||
</array>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>CFBundleTypeRole</key>
|
||||
<string>Editor</string>
|
||||
@@ -88,8 +78,6 @@
|
||||
<string>[auto]</string>
|
||||
<key>FacebookAppID</key>
|
||||
<string>257095917745237</string>
|
||||
<key>GooglePlusClientID</key>
|
||||
<string>1098891429568.apps.googleusercontent.com</string>
|
||||
<key>LSRequiresIPhoneOS</key>
|
||||
<true/>
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
@@ -119,10 +107,6 @@
|
||||
<string>MainStoryboard_iPhone</string>
|
||||
<key>UIPrerenderedIcon</key>
|
||||
<true/>
|
||||
<key>UIRequiredDeviceCapabilities</key>
|
||||
<array>
|
||||
<string>armv7</string>
|
||||
</array>
|
||||
<key>UIStatusBarHidden</key>
|
||||
<true/>
|
||||
<key>UIStatusBarStyle</key>
|
||||
|
||||
Reference in New Issue
Block a user