Skip to content

Commit

Permalink
Merge pull request #685 from hello/jimmy/fb-fix
Browse files Browse the repository at this point in the history
Fix issue with FB OAuth callback
  • Loading branch information
jimmymlu authored Sep 27, 2016
2 parents 30ebaa0 + d1354dd commit f9892c2
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 17 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## 1.5.3.11

Fixes:

* Fix issue where FB Oauth response was not properly being routed back to the app

## 1.5.3.10

Fixes:
Expand Down
2 changes: 1 addition & 1 deletion Extensions/RoomConditions/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.5.3.10</string>
<string>1.5.3.11</string>
<key>NSExtension</key>
<dict>
<key>NSExtensionMainStoryboard</key>
Expand Down
25 changes: 10 additions & 15 deletions SleepModel/HEMAppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -57,26 +57,21 @@ - (BOOL)application:(UIApplication*)application didFinishLaunchingWithOptions:(N
return YES;
}

- (BOOL)application:(UIApplication *)app
openURL:(NSURL *)url
options:(NSDictionary<NSString *,id> *)options {
NSString* lastPath = [url lastPathComponent];
if ([lastPath isEqualToString:kHEMAppExtRoom]) {
NSDictionary* props = @{kHEMAnalyticsEventPropExtUrl : [url absoluteString] ?: @""};
[SENAnalytics track:kHEMAnalyticsEventLaunchedFromExt properties:props];
HEMRootViewController* rootVC = [HEMRootViewController rootViewControllerForKeyWindow];
[rootVC showSettingsDrawerTabAtIndex:HEMRootDrawerTabConditions animated:YES];
return YES;
}
return NO;
}

- (BOOL)application:(UIApplication *)application
openURL:(NSURL *)url
sourceApplication:(NSString *)sourceApplication
annotation:(id)annotation {
HEMFacebookService* fb = [HEMFacebookService new];
return [fb open:application url:url source:sourceApplication annotation:annotation];
if (![fb open:application url:url source:sourceApplication annotation:annotation]) {
NSString* lastPath = [url lastPathComponent];
if ([lastPath isEqualToString:kHEMAppExtRoom]) {
NSDictionary* props = @{kHEMAnalyticsEventPropExtUrl : [url absoluteString] ?: @""};
[SENAnalytics track:kHEMAnalyticsEventLaunchedFromExt properties:props];
HEMRootViewController* rootVC = [HEMRootViewController rootViewControllerForKeyWindow];
[rootVC showSettingsDrawerTabAtIndex:HEMRootDrawerTabConditions animated:YES];
}
}
return YES;
}

- (void)application:(UIApplication *)application performActionForShortcutItem:(UIApplicationShortcutItem *)shortcutItem completionHandler:(void (^)(BOOL))completionHandler {
Expand Down
2 changes: 1 addition & 1 deletion SleepModel/Sense-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>1.5.3.10</string>
<string>1.5.3.11</string>
<key>FacebookAppID</key>
<string>372438546161587</string>
<key>FacebookDisplayName</key>
Expand Down

0 comments on commit f9892c2

Please sign in to comment.