Facebook Login does not return to App with Xcode 7 iOS 9 - facebook-login

I have implemented this method for Facebook Login in the App Delegate using Xcode 7 and it works perfectly:
- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<NSString*, id> *)options {
return [[FBSDKApplicationDelegate sharedInstance] application:app
openURL:url
sourceApplication:options[UIApplicationOpenURLOptionsSourceApplicationKey]
annotation:options[UIApplicationOpenURLOptionsAnnotationKey]];
}
However, since I need to use Xcode 6 to submit my app to the App Store, this method does not exists and it give me errors.
If I comment the above method, and leave only the following:
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation {
return [[FBSDKApplicationDelegate sharedInstance] application:application
openURL:url
sourceApplication:sourceApplication
annotation:annotation
];
}
it will not work, that is, when the user tries to Login, it does not return to the Application.
Is there an easy fix for this? Thanks!
BTW, I have followed diligently all steps in : https://developers.facebook.com/docs/ios/getting-started

Seems there's no way to get the previous behavior using newests FB SDKs in iOS9. You can use a old SDK to do that. Here's a response from the facebook to that question:

Related

“The page has expired due to inactivity” appears when using a services methods - Laravel 5.5

According to other asked questions like this one, I did many doings to prevent this request expired message but there is no solution for my issue.
In the long run I recognized that the message appears when I call a service method inside a controller which run on form action!
Here is my codes samples with some descriptions:
My route:
Route::post('Material/{id}', 'MaterialController#updateMaterial')->name('updateMaterial');
Material Controller Constructor:
public function __construct(CustomService $srv)
{
$this->middleware('admin')->only(['updateMaterial']);
$this->srv= $srv;
}
srv is a protected attribute in MaterialController class.
updateMaterial Method:
public function updateMaterial($id,Request $request)
{
$this->validate($request, [...]);
$material = $this->srv->updateMaterial($request, $id);
if ($material)
return view('panel._materials.edit-material')
->with('material', $material)
->with('success', 1);
}
I also have a provider for CustomService with name CustomServiceProvider and here is the register method of the provider:
public function register()
{
$this->app->bind(CustomService::class,function($app){
return new CustomService();
});
}
and I registered it as a provider in config/app.php.
So when I return something before calling service updateMaterial method, it's OK. but when the method runs, the issue appears!
I don'n have any idea about!
Update:
And here is updateMaterial of CustomService:
public function updateMaterial($request, $id)
{
$material = Material::find($id);
if (!$material)
return false;
if ($request->has('unit'))
$material->unit = $request['unit'];
if ($request->has('price'))
$material->price = $request['price'];
if ($request->has('type'))
$material->type = $request['type'];
if ($request->has('is_active'))
$material->is_active = $request['is_active'];
$material->updated_at = Carbon::now();
$material->save();
return $material;
}
I also create a new project with Laravel 5.5.0 and without adding any complexity I just added a post route and call it in form action, but nothing changed!
This is just an issue for Windows users on Local Environment. I suffered a lot with this also when on Windows. Once you deploy to your production server, you won't have any issue at all.
It's important to note that this is not an issue with Laravel 5.5 version only. I first saw this issue in version 5.2.
I think a good fix for this would maybe be using something like Homestead or Vessel from Fideloper. Honestly I only suffered this problem when using Windows.

xcode 8 PHPhotoLibrary.requestAuthorization causing crash

My app keeps crashing when running in the simulator everytime I try to request authorization for the photo library. I am using the following code in my appDelegate in didFinishLaunchingWithOptions:
if PHPhotoLibrary.authorizationStatus() != PHAuthorizationStatus.authorized {
PHPhotoLibrary.requestAuthorization({ (status: PHAuthorizationStatus) in
})
}
Using xcode 8 beta with swift 3.0.
In my testing, iOS 10 doesn't like to output useful error messages unless you're running on an actual device. In this particular case, you probably haven't provided the key NSPhotoLibraryUsageDescription in your Info.plist file, and that value must be provided before requesting authorization.
Have to allow access to photos on device. Add below key and string to your info.plist. The autocomplete in the property list view is "Privacy - Photo Library Usage Description". Or just open your info.plist in source code view and add the following:
<key>NSPhotoLibraryUsageDescription</key>
<string>We need access to your photos.</string>

UIDocumentPickerViewController not loading document from iCloud on device

I just tried to add iOS's document picker (UIDocumentPickerViewController) as directed by the Document Picker Programming Guide
I'm trying to Import (i.e. copy locally...hopefully the simplest case) a file using the iCloud document provider (I've tested others such as DropBox and Google Drive and they work fine). Here's how I call up the document picker menu:
...
UIDocumentMenuViewController *documentPickerMenu = [[UIDocumentMenuViewController alloc]
initWithDocumentTypes:#[#"public.text", #"public.data"]
inMode:UIDocumentPickerModeImport];
documentPickerMenu.delegate = self;
[self presentViewController:documentPickerMenu animated:YES completion:nil];
...
and here is how I bring up the provider-specific document picker:
- (void)documentMenu:(UIDocumentMenuViewController *)documentMenu didPickDocumentPicker:(UIDocumentPickerViewController *)documentPicker
{
documentPicker.delegate = self;
[self presentViewController:documentPicker animated:YES completion:nil];
}
and here is my delegate function, which never gets called (i.e. never see log line, breakpoint never hit):
- (void)documentPicker:(UIDocumentPickerViewController *)controller didPickDocumentAtURL:(NSURL *)url {
if (controller.documentPickerMode == UIDocumentPickerModeImport) {
NSLog(#"Opened %#", url.path);
}
}
I tested it and it worked fine on the iOS simulator. However when I load it on an iOS device (an iPad), the document picker comes up fine, shows me valid iCloud documents, but when I pick one all I see in the console is:
plugin com.apple.UIKit.fileprovider.default invalidated
And my delegate function UIDocumentPickerDelegate:didPickDocumentAtURL: function is never called.
I believe I have properly provisioned the application with the iCloud entitlements.
Can someone please help?

CaptureError.CAPTURE_INTERNAL_ERR on Android trying to use capture.captureImage

I am trying to write a hybrid app for Android using VS 2013 update 3 and the multi-device hybrid app extension (Cordova v3.5.0). Everything is working well except the Media Capture plugin. I am calling navigator.device.capture.captureImage(MediaCaptureSuccess, MediaCaptureError, { limit: 3 }) which opens up the camera app. I can take a picture but when I click Ok on the device, my error callback is executed with CaptureError.CAPTURE_INTERNAL_ERR with no other information. I have tried switching to org.apache.cordova.media-capture#0.3.4 (currently using 0.3.1) but when I try to compile, I get a plugman error when it tries to retrieve it. I have searched the debug output for clues and the only thing that I found was the following line "Unknown permission android.permission.RECORD_VIDEO in package..." but that seems to be a valid user permission. When I look at capture.java generated by the build, I can see that this error is returned if there is an IOException occurs.
Does anyone have any suggestions on how to fix this or what to check next?
Try this plugin
Config:
<vs:feature>org.apache.cordova.camera#0.3.0</vs:feature>
JS:
navigator.camera.getPicture(onSuccess, onFail, {
quality: 30,
destinationType: Camera.DestinationType.FILE_URI,
saveToPhotoAlbum: true
});

Blackberry facebook SDK login browser error

I recently switched from using the BlackBerry Facebook SDK jar to using the project's source code (checked out from the tag that the jar was built from).
Ever since this switch, I've experienced BrowserField problems:
On a device, the loading graphics persists until I back out.
On a simulator I see:
Error requesting content for
https://www.facebook.com/dialog/oauth?scope=user_about_me,user_activities,user_birthday,user_education_history,user_events,user_groups,user_hometown,user_interests,user_likes,user_location,user_notes,user_online_presence,user_photo_video_tags,user_photos,user_relationships,user_relationship_details,user_religion_politics,user_status,user_videos,user_website,user_work_history,email,read_friendlists,read_insights,read_mailbox,read_requests,read_stream,xmpp_login,ads_management,user_checkins,friends_about_me,friends_activities,friends_birthday,friends_education_history,friends_events,friends_groups,friends_hometown,friends_interests,friends_likes,friends_location,friends_notes,friends_online_presence,friends_photo_video_tags,friends_photos,friends_relationships,friends_relationship_details,friends_religion_politics,friends_status,friends_videos,friends_website,friends_work_history,manage_friendlists,friends_checkins,publish_stream,create_event,rsvp_event,offline_access,publish_checkins,manage_pages&redirect_uri=http://www.facebook.com/connect/login_success.html&display=wap&client_id=[APPLICATION_ID]&response_type=token
Error message null.
where APPLICATION_ID is my correct application ID.
The above URL opens fine in my PC browser, and I have debugged for a while through the Facebook sdk's source and found nothing.
It is possible that the application id might have changed recently without me knowing, and my next step is to revert back to using the .jar just for testing purposes.
Has anyone seen similar behavior with the BlackBerry SDK before?
I'm not sure if this is what happened in your case, but I've seen that error when the ProtocolController is set before the BrowserField is initialized. Like so:
private BrowserField bf;
...
BrowserFieldConfig bfc = new BrowserFieldConfig();
// bf not initialized yet but no compiler error
bfc.setProperty(BrowserFieldConfig.CONTROLLER, new ProtocolController(bf){
public void handleNavigationRequest(BrowserFieldRequest request) throws Exception {
super.handleNavigationRequest(request);
}
public InputConnection handleResourceRequest(BrowserFieldRequest request) throws Exception {
return super.handleResourceRequest(request);
}
});
bf = new BrowserField(bfc);
add(bf);
bf.requestContent("http://www.google.com");
...
Simply setting the ProtocolController after the BrowserField is initialized but before content is requested solves it.