我已经将iPhone 6 plus更新到iOS 9测试版,并试图执行Facebook登录,但每次使用Facebook登录表单呈现UIWebView.
我有Facebook sdk
FB_IOS_SDK_VERSION_STRING @"3.24.0"
FB_IOS_SDK_TARGET_PLATFORM_VERSION @"v2.2"
Run Code Online (Sandbox Code Playgroud)
我正在使用以下方法来执行Facebook登录
NSArray *permissions = @[@"email",@"user_birthday",@"public_profile"];
FBSessionStateHandler completionHandler = ^(FBSession *session, FBSessionState status, NSError *error) {
[self sessionStateChanged:session state:status error:error];
};
if ([FBSession activeSession].state == FBSessionStateCreatedTokenLoaded) {
// we have a cached token, so open the session
[[FBSession activeSession]openWithBehavior:FBSessionLoginBehaviorUseSystemAccountIfPresent
fromViewController:nil
completionHandler:completionHandler];
} else {
[self clearAllUserInfo];
[[NSURLCache sharedURLCache] removeAllCachedResponses];
// create a new facebook session
FBSession *fbSession = [[FBSession alloc] initWithPermissions:permissions];
[FBSession setActiveSession:fbSession];
[fbSession openWithBehavior:FBSessionLoginBehaviorUseSystemAccountIfPresent
fromViewController:nil
completionHandler:completionHandler];
}
Run Code Online (Sandbox Code Playgroud)
我在plist文件下面进行了以下设置
<key>LSApplicationQueriesSchemes</key>
<array> …Run Code Online (Sandbox Code Playgroud) 甚至我的应用程序都在后台注册位置更新.
在我的代码中:
self.locationManager.desiredAccuracy = kCLLocationAccuracyThreeKilometers;
self.locationManager.distanceFilter = 2500;
Run Code Online (Sandbox Code Playgroud)
我没有搬到任何地方.因此,在控制台日志中完成15分钟后,我收到此消息"位置图标现在应处于"非活动状态".从这一点开始,我的应用程序不在后台运行.
它只在iPhone 5中发生.
@更新
这是我的代码
self.locationManager = [[CLLocationManager alloc] init];
self.locationManager.delegate = self;
[self.locationManager setPurpose:@"Enable Location service for \"My App\" to track your"];
self.locationManager.desiredAccuracy = kCLLocationAccuracyThreeKilometers;
/* Notify changes when device has moved x meters.
* Default value is kCLDistanceFilterNone: all movements are reported.
*/
self.locationManager.distanceFilter = 2500;
[self.locationManager startUpdatingLocation];
Run Code Online (Sandbox Code Playgroud) 在阅读了一些关于它的其他猜测后,我尝试过:
在ViewController.m上
DelegateScrollView ScrollView;
-(void)viewDidLoad
{
[super viewDidLoad];
ScrollView = [[DelegateScrollView alloc] initWithFrame:CGRectMake(0,- self.view.frame.size.height, self.view.frame.size.width, self.view.frame.size.height)];
ScrollView.delegate = ScrollView;
ScrollView.scrollEnabled = YES;
ScrollView.backgroundColor = [UIColor blackColor ];
ScrollView.maximumZoomScale = 5.0f;
ScrollView.minimumZoomScale = 1.0f;
[self.view addSubview:ScrollView];
[ScrollView setZoomScale:2 animated:YES];
}
Run Code Online (Sandbox Code Playgroud)
DelegateScrollView.h:
@interface ChildDelegateScrollView : UIScrollView <UIScrollViewDelegate>
@end
Run Code Online (Sandbox Code Playgroud)
并且zoom也永远不会发生我也在ViewController.h中试过这个:@interface ViewController : UIViewController <UIScrollViewDelegate> 然后像这样设置委托ScrollView.delegate = self;而不起作用,如何正确设置ScrollView的委托?