objective-c 由于模拟器错误,退回到从 NSUserDefaults 加载访问令牌

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/41033776/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-03 23:08:47  来源:igfitidea点击:

Falling back to loading access token from NSUserDefaults because of simulator bug

objective-cios10xcode8.1

提问by Ramkumar

Xcode log show the above error while running in Xcode 8.1, ios 10.1. Is there any problem or should I ignore and continue?

在 Xcode 8.1、ios 10.1 中运行时,Xcode 日志显示上述错误。有什么问题还是我应该忽略并继续?

回答by ibtokin

I have this problem, too. It seems to be caused by an the Facebook SDK's Login Access Token. It caches just fine on a real device, but not on the simulators. Try running the app from a physical device.

我也有这个问题。这似乎是由 Facebook SDK 的登录访问令牌引起的。它在真实设备上缓存得很好,但不能在模拟器上缓存。尝试从物理设备运行该应用程序。

回答by Jorn van Dijk

You can ignore this warning, it's hard coded in the FacebookSDK when using the iOS Simulator. The SDK does contain a bug though which prevents the simulator from caching the access token.

您可以忽略此警告,它在使用 iOS 模拟器时在 FacebookSDK 中进行了硬编码。SDK 确实包含一个错误,该错误会阻止模拟器缓存访问令牌。

You can fix this by adding the following line:

您可以通过添加以下行来解决此问题:

key = [NSString stringWithFormat:@"%@_fix", key];

key = [NSString stringWithFormat:@"%@_fix", key];

in FBSDKKeychainStore.m:94and FBSDKKeychainStore.m:135just before:

FBSDKKeychainStore.m:94FBSDKKeychainStore.m:135之前:

[[NSUserDefaults standardUserDefaults] setObject:value forKey:key];

[[NSUserDefaults standardUserDefaults] setObject:value forKey:key];

回答by Nghi Nguyen

I had the same problem. I tried to run in real device and this show error with OAuth Login Then I just turn OAuth Login on and everything works well Turn on OAuth Login

我有同样的问题。我尝试在真实设备中运行,并且 OAuth 登录显示错误然后我打开 OAuth 登录,一切正常 Turn on OAuth Login