Socket
Socket
Sign inDemoInstall

cordova-plugin-facebook-connect

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cordova-plugin-facebook-connect - npm Package Compare versions

Comparing version 2.3.0 to 3.0.0

21

CHANGELOG.md

@@ -0,1 +1,22 @@

<a name="3.0.0"></a>
# [3.0.0](https://github.com/cordova-plugin-facebook-connect/cordova-plugin-facebook-connect/releases/tag/v3.0.0) (2021-08-17)
## Breaking Changes
* Dropped support for cordova-ios 5 (closes [#40](https://github.com/cordova-plugin-facebook-connect/cordova-plugin-facebook-connect/issues/40))
* Dropped support for iOS 8 and below (closes [#41](https://github.com/cordova-plugin-facebook-connect/cordova-plugin-facebook-connect/issues/41))
* Updated the `login` method error callback to return an object on iOS as on Android (closes [#19](https://github.com/cordova-plugin-facebook-connect/cordova-plugin-facebook-connect/issues/19))
## Features
* Updated the Facebook SDK to 11.2.0 for Android and 11.1.0 for iOS
* Updated the Facebook JavaScript SDK used by the browser platform to v11.0
* Updated the object returned by methods such as `login` to remove the `secret`, `session_key`, and `sig` properties, and add the new `data_access_expiration_time` property (closes [#49](https://github.com/cordova-plugin-facebook-connect/cordova-plugin-facebook-connect/issues/49))
* Added new `getApplicationId`, `setApplicationId`, `getApplicationName`, and `setApplicationName` methods to allow for dynamically switching between app IDs in code (closes [#61](https://github.com/cordova-plugin-facebook-connect/cordova-plugin-facebook-connect/issues/61))
* Added new `OTHER_APP_SCHEMES` variable which is required for iOS when using `setApplicationId` to switch between multiple app IDs
## Bug Fixes
* Fixed an issue that would cause the *-Info.plist file to have a null value if FACEBOOK_URL_SCHEME_SUFFIX was null (closes [#77](https://github.com/cordova-plugin-facebook-connect/cordova-plugin-facebook-connect/issues/77))
<a name="2.3.0"></a>

@@ -2,0 +23,0 @@ # [2.3.0](https://github.com/cordova-plugin-facebook-connect/cordova-plugin-facebook-connect/releases/tag/v2.3.0) (2021-04-21)

12

docs/ios/README.md

@@ -46,13 +46,1 @@ # Facebook Requirements and Set-Up [iOS]

```
#### 'FBSDKCoreKit/FBSDKCoreKit.h' file not found
If you are using Cordova iOS < v5, you might face the error `'FBSDKCoreKit/FBSDKCoreKit.h' file not found`. To overcome this problem, edit the `plugin.xml` of the plugin in order to fetch de Facebook iOS SDK by adding the following `framework` references:
```
<framework src="FBSDKCoreKit" type="podspec" spec="X.Y.Z" />
<framework src="FBSDKLoginKit" type="podspec" spec="X.Y.Z" />
<framework src="FBSDKShareKit" type="podspec" spec="X.Y.Z" />
```
Replace `X.Y.Z` with the Facebook iOS SDK and remove and add your platform again.

2

package.json
{
"name": "cordova-plugin-facebook-connect",
"version": "2.3.0",
"version": "3.0.0",
"description": "Cordova Facebook SDK Plugin",

@@ -5,0 +5,0 @@ "cordova": {

@@ -52,3 +52,3 @@ # cordova-plugin-facebook-connect

* cordova-android >= 7.0.0
* cordova-ios >= 5.0.0
* cordova-ios >= 6.0.0
* cordova-browser >= 3.6

@@ -70,2 +70,30 @@

### Get Application ID and Name
`facebookConnectPlugin.getApplicationId(Function success)`
Success function returns the current application ID.
`facebookConnectPlugin.getApplicationName(Function success)`
Success function returns the current application name.
### Set Application ID and Name
By default, the APP_ID and APP_NAME provided when the plugin is added are used. If you instead need to set the application ID and name in code, you can do so. (You must still include an APP_ID and APP_NAME when adding the plugin, as the values are required for the Android manifest and *-Info.plist files.)
`facebookConnectPlugin.setApplicationId(String id, Function success)`
Success function indicates the application ID has been updated.
`facebookConnectPlugin.setApplicationName(String name, Function success)`
Success function indicates the application name has been updated.
Note that in order to dynamically switch between multiple app IDs on iOS, you must use the *OTHER_APP_SCHEMES* variable and specify each additional app ID you will use with `setApplicationId` separated by a comma, e.g.
```bash
$ cordova plugin add cordova-plugin-facebook-connect --save --variable APP_ID="123456789" --variable APP_NAME="myApplication" --variable OTHER_APP_SCHEMES="fb987654321,fb876543210,fb765432109"
```
### Login

@@ -80,7 +108,5 @@

authResponse: {
session_key: true,
accessToken: "<long string>",
expiresIn: 5183979,
sig: "...",
secret: "...",
data_access_expiration_time: "1623680244",
expiresIn: "5183979",
userID: "634565435"

@@ -90,4 +116,9 @@ }

Failure function returns an error String.
Failure function returns an Object like:
{
errorCode: "4201",
errorMessage: "User cancelled"
}
### Limited Login (iOS Only)

@@ -108,4 +139,9 @@

Failure function returns an error String.
Failure function returns an Object like:
{
errorCode: "4201",
errorMessage: "User cancelled"
}
See the [Facebook Developer documentation](https://developers.facebook.com/docs/facebook-login/limited-login/ios/) for more details.

@@ -152,7 +188,6 @@

authResponse: {
userID: "12345678912345",
accessToken: "kgkh3g42kh4g23kh4g2kh34g2kg4k2h4gkh3g4k2h4gk23h4gk2h34gk234gk2h34AndSoOn",
session_Key: true,
data_access_expiration_time: "1623680244",
expiresIn: "5183738",
sig: "..."
userID: "12345678912345"
},

@@ -184,7 +219,5 @@ status: "connected"

authResponse: {
session_key: true,
accessToken: "<long string>",
expiresIn: 5183979,
sig: "...",
secret: "...",
data_access_expiration_time: "1623680244",
expiresIn: "5183979",
userID: "634565435"

@@ -379,4 +412,2 @@ }

**NOTE(iOS):** This feature only works with WKWebView so if using an old version of Cordova, an additional plugin (e.g cordova-plugin-wkwebview-engine) is needed.
## GDPR Compliance

@@ -383,0 +414,0 @@

@@ -35,3 +35,2 @@ 'use strict';

var FACEBOOK_URL_SCHEME_SUFFIX = ' '
if(process.argv.join("|").indexOf("FACEBOOK_URL_SCHEME_SUFFIX=") > -1) {

@@ -42,9 +41,17 @@ FACEBOOK_URL_SCHEME_SUFFIX = process.argv.join("|").match(/FACEBOOK_URL_SCHEME_SUFFIX=(.*?)(\||$)/)[1]

}
if(FACEBOOK_URL_SCHEME_SUFFIX === ' ') {
if(!FACEBOOK_URL_SCHEME_SUFFIX || FACEBOOK_URL_SCHEME_SUFFIX === ' ') {
FACEBOOK_URL_SCHEME_SUFFIX = ''
}
var OTHER_APP_SCHEMES = ' '
if(process.argv.join("|").indexOf("OTHER_APP_SCHEMES=") > -1) {
OTHER_APP_SCHEMES = process.argv.join("|").match(/OTHER_APP_SCHEMES=(.*?)(\||$)/)[1]
} else {
OTHER_APP_SCHEMES = getPreferenceValue("OTHER_APP_SCHEMES")
}
if(!OTHER_APP_SCHEMES || OTHER_APP_SCHEMES === ' ') {
OTHER_APP_SCHEMES = ''
}
var FACEBOOK_AUTO_LOG_APP_EVENTS = 'true'
if(process.argv.join("|").indexOf("FACEBOOK_AUTO_LOG_APP_EVENTS=") > -1) {

@@ -55,3 +62,2 @@ FACEBOOK_AUTO_LOG_APP_EVENTS = process.argv.join("|").match(/FACEBOOK_AUTO_LOG_APP_EVENTS=(.*?)(\||$)/)[1]

}
if(typeof FACEBOOK_AUTO_LOG_APP_EVENTS == 'string' && FACEBOOK_AUTO_LOG_APP_EVENTS.toLowerCase() == 'false') {

@@ -64,3 +70,2 @@ FACEBOOK_AUTO_LOG_APP_EVENTS = 'false'

var FACEBOOK_ADVERTISER_ID_COLLECTION = 'true'
if(process.argv.join("|").indexOf("FACEBOOK_ADVERTISER_ID_COLLECTION=") > -1) {

@@ -71,3 +76,2 @@ FACEBOOK_ADVERTISER_ID_COLLECTION = process.argv.join("|").match(/FACEBOOK_ADVERTISER_ID_COLLECTION=(.*?)(\||$)/)[1]

}
if(typeof FACEBOOK_ADVERTISER_ID_COLLECTION == 'string' && FACEBOOK_ADVERTISER_ID_COLLECTION.toLowerCase() == 'false') {

@@ -97,4 +101,14 @@ FACEBOOK_ADVERTISER_ID_COLLECTION = 'false'

if(FACEBOOK_URL_SCHEME_SUFFIX === '') {
plistContent = plistContent.replace('<key>FacebookUrlSchemeSuffix</key>', '').replace('<string>FACEBOOK_URL_SCHEME_SUFFIX_PLACEHOLDER</string>', '')
}
plistContent = plistContent.replace(/FACEBOOK_URL_SCHEME_SUFFIX_PLACEHOLDER/g, FACEBOOK_URL_SCHEME_SUFFIX)
if(OTHER_APP_SCHEMES === '') {
plistContent = plistContent.replace('<string>OTHER_APP_SCHEMES_PLACEHOLDER</string>', '')
} else {
var otherAppSchemeStrings = OTHER_APP_SCHEMES.replace(/,/g, '</string><string>')
plistContent = plistContent.replace('OTHER_APP_SCHEMES_PLACEHOLDER', otherAppSchemeStrings)
}
if(plistContent.indexOf('<key>FacebookAutoLogAppEventsEnabled</key>') == -1) {

@@ -101,0 +115,0 @@ plistContent = plistContent.replace('<key>FacebookAutoLogAppEventsEnabled_PLACEHOLDER</key>', '<key>FacebookAutoLogAppEventsEnabled</key>').replace('<string>FACEBOOK_AUTO_LOG_APP_EVENTS_PLACEHOLDER</string>', '<' + FACEBOOK_AUTO_LOG_APP_EVENTS + ' />')

var exec = require('cordova/exec')
exports.getApplicationId = function (s, f) {
exec(s, f, 'FacebookConnectPlugin', 'getApplicationId', [])
}
exports.setApplicationId = function (appId, s, f) {
exec(s, f, 'FacebookConnectPlugin', 'setApplicationId', [appId])
}
exports.getApplicationName = function (s, f) {
exec(s, f, 'FacebookConnectPlugin', 'getApplicationName', [])
}
exports.setApplicationName = function (appName, s, f) {
exec(s, f, 'FacebookConnectPlugin', 'setApplicationName', [appName])
}
exports.getLoginStatus = function (force, s, f) {

@@ -4,0 +20,0 @@ if (typeof force === 'function') {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc