Skip to content

Try to implement Facebook SDKs as a real life example of 3rd party plugin #220

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
valentinstoychev opened this issue Jul 13, 2015 · 18 comments

Comments

@valentinstoychev
Copy link

We need to make sure that everything in the runtime is prepared to handle real life scenarios.

https://developers.facebook.com/docs/ios

Not officially supported plugin - just POC app that uses the FB services/APIs.

@PanayotCankov PanayotCankov added this to the 1.3.0 (Under Review) milestone Jul 21, 2015
@jasssonpet
Copy link
Contributor

Related to #150

@jasssonpet
Copy link
Contributor

Following the getting started guide (using CocoaPods instead of step 4) I managed to create a simple login button and log the signed user's name: https://gist.github.com/jasssonpet/7bd32f4316fbe5bff24d

@fealebenpae
Copy link
Contributor

In order to create a more automatic Facebook SDK plugin experience for NativeScript, the CLI should support not only CocoaPods, but user-defined plugin parameters as well.

@ligaz
Copy link

ligaz commented Aug 19, 2015

We have already logged this for implementation here. Can you elaborate more on how you envision the plugin variables to work? From what I can see in the gist we need the ability to replace some placeholders in the Info.plist that comes with the plugin.

@fealebenpae
Copy link
Contributor

For iOS perhaps Info.plist would be the only place we would need to perform variable substitution, and we can rely on Xcode to do that as long as the variables are build settings in an .xcconfig file for example.

For Android I imagine that plugins that rely on being able to add broadcast receivers or some such would need to alter their source code to incorporate the package identifier of the application they're being added to.

I think we should look at the various scenarios Cordova's plugman tries to support with variables and see what sort overlap there is with the problems we're trying to solve now. The Facebook iOS SDK is an ideal example of such overlap IMO.

@fealebenpae
Copy link
Contributor

Right now the Facebook SDK is available either as a CocoaPod, or as a magical static framework that has a modulemap and an Info,plist, but is a static library at heart. Since we provide automatic handling for neither, the Facebook SDK plugin will have to be sadly postponed.

@fealebenpae fealebenpae removed this from the 1.3.0 milestone Aug 24, 2015
@atanasovg atanasovg added this to the 1.4.0 (Under review) milestone Sep 7, 2015
@polkhovsky
Copy link

Guys. A Facebook and Twitter plugins should've been ones of the first plugins to get implemented. Having users create username/password based profiles in mobile is no longer a viable design (IMHO). I was very excited and started a new app using NativeScript only to stop in my tracks almost immediately after encountering this problem. Without this I can't use NS for anything that I planned to do with it. I hope you will implement this very soon. But it's back to other frameworks for me right now.

@jasssonpet
Copy link
Contributor

Hello, @polkhovsky!

We are working on providing the Facebook SDK for iOS as a NativeScript plugin. It should be on track for the 1.4 release. This will allow users to use the native API provided by Facebook.

If you are looking for a cross-platform plugin working on both iOS and Android with unified API, you could log it as an idea in the Idea Portal.

@jasssonpet
Copy link
Contributor

Due to some complications with xcconfig files (NativeScript/nativescript-cli#883) and some external constants that would get stripped (e.g. FBAdSize) from the static libraries, the plugin is going to use CocoaPods. This means it will work on iOS 8+ only.

@jasssonpet jasssonpet removed this from the 1.4.0 milestone Oct 2, 2015
@jasssonpet
Copy link
Contributor

This plugin requires plugin variables support (NativeScript/nativescript-cli#882) from the CLI, which will be implemented in 1.4.1.

@jasssonpet jasssonpet added this to the 1.5.0 (Under Review) milestone Oct 2, 2015
@jlooper
Copy link

jlooper commented Oct 22, 2015

I've been working with the developer of this plugin: https://www.npmjs.com/package/nativescript-facebook-login which does work on simulator and can post login data to Everlive, but I'm having trouble making it work on device due to linker problems with the Bolt framework (whatever, Facebook!).

Both our homegrown plugins and this community-grown plugins currently have limitations - the community one has problems on device and the homegrown one seems iOS-only, whereas I need a cross-platform solution. Wondering if we can bump up the priority on this feature. I'd love to write a blogpost on it when it gets done.

@jasssonpet
Copy link
Contributor

A POC plugin is available here: https://github.com/NativeScript/nativescript-facebook-plugin

For a cross-platform plugin please vote here: https://nativescript.ideas.aha.io/ideas/NS-I-63

@benkingcode
Copy link

@jasssonpet That link doesn't work

@jlooper
Copy link

jlooper commented Nov 2, 2015

I don't think this should be closed until we have a solid, cross-platform plugin for Facebook. The POC above is for iOS only as I understand, and the other one I mention above crashes on device. This is really, really important to a lot of developers to have social logins working properly for real-world apps. Thanks!

@jasssonpet
Copy link
Contributor

@dbbk The link should be working as of by now.

@benkingcode
Copy link

@jasssonpet Thanks

Strongly agree with @jlooper

@fealebenpae
Copy link
Contributor

@jlooper, we are accepting contributions for this :)

The idea behind this is to do the heavy lifting that will link the Facebook libraries and configure the the Info.plist file as the Facebook SDK expects. Beyond that, we would love it if the community could build upon this foundation with an Android implementation, and a common JavaScript API to unify the iOS and Android Facebook SDKs.

@fealebenpae
Copy link
Contributor

I think the best way to move this forward is to create a new issue in NativeScript/NativeScript for a comprehensive Facebook plugin, both to give it more visibility and to extend the scope of this POC issue.

We'll leave this issue closed, but please feel free to comment here for historic context.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants