Skip to content
This repository was archived by the owner on Jan 4, 2021. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,8 @@
/src/node_modules
/src/hooks
*.log
.DS_Store
.DS_Store

.vscode/settings.json
demo/giddh.keystore
.idea/*
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
| Google | Yes | Yes |
| Facebook | Yes | Yes |
| Twitter | No | No |
| Linkedin | Yes | Yes |

## License

Expand Down Expand Up @@ -144,6 +145,18 @@ Add the following to your Info.plist file located in app/App_Resources/iOS
<string>FacebookLoginDemo</string>
<!-- FACEBOOK END -->

<key>LIAppId</key>
<string>{YOUR_LINKEDIN_APPID}</string>
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLSchemes</key>
<array>
<string>li{YOUR_LINKEDIN_SECREAT}</string>
</array>
</dict>
</array>

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

Expand Down
12 changes: 12 additions & 0 deletions demo/app/App_Resources/iOS/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,18 @@
<key>FacebookDisplayName</key>
<string>Cheefo nativescript test</string>
<!-- FACEBOOK END -->
<key>LIAppId</key>
<string>{YOUR_LINKEDIN_APPID}</string>
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLSchemes</key>
<array>
<string>li{YOUR_LINKEDIN_SECREAT}</string>
</array>
</dict>
</array>


</dict>
</plist>
6 changes: 5 additions & 1 deletion demo/app/app.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 24 additions & 8 deletions demo/app/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,33 @@ declare var android: any;
// declare var UIApplication: any;
// declare var UIApplicationDelegate: any;

declare class UIResponder {};
declare class UIApplicationDelegate{};
declare class UIResponder { };
declare class UIApplicationDelegate { };
declare class FBSDKApplicationDelegate {
static sharedInstance():any;
static sharedInstance(): any;

};
declare class LinkedinSwiftHelper {
static shouldHandleUrl(url: string): any;
static application(application: any,
openURL: any,
sourceApplication: any,
annotation: any): any;
}

declare class GGLContext {
static sharedInstance():any;
static sharedInstance(): any;
};

declare class GIDSignIn {
static sharedInstance():any;
static sharedInstance(): any;
};

declare class FBSDKAppEvents{
declare class FBSDKAppEvents {
static activateApp();
};
declare class UIApplication {};
declare class NSDictionary {};
declare class UIApplication { };
declare class NSDictionary { };


if (application.ios) {
Expand Down Expand Up @@ -57,6 +65,14 @@ if (application.ios) {
applicationOpenURLSourceApplicationAnnotation(application, url, sourceApplication, annotation) {
const fcbDelegate = FBSDKApplicationDelegate.sharedInstance().applicationOpenURLSourceApplicationAnnotation(application, url, sourceApplication, annotation); // facebook login delegate
const gglDelegate = GIDSignIn.sharedInstance().handleURLSourceApplicationAnnotation(url, sourceApplication, annotation); // google login delegate
const linkinDelegate = false;
if (LinkedinSwiftHelper.shouldHandleUrl(url)) {
let linkinDelegate = LinkedinSwiftHelper.application(application,
url,
sourceApplication,
annotation
);
}

return fcbDelegate || gglDelegate;
}
Expand Down
Binary file added demo/app/img/linkedin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 6 additions & 2 deletions demo/app/main-page.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

<Button text="Save settings"
tap="{{ saveSettings }}" />

<Label verticalAlignment="stretch"
text="{{ initResultLog }}"
textWrap="true" />
Expand All @@ -30,6 +29,7 @@
<TabViewItem title="Buttons">
<TabViewItem.view>
<StackLayout className="mjk-buttons">
<Button text="logout" tap="{{ }}" />
<!-- Facebook login -->
<Image src="~/img/Vk9SO.png"
visibility="{{ initResult &amp;&amp; initResult.facebook.isInitialized ? 'visible' : 'collapsed' }}"
Expand All @@ -40,6 +40,10 @@
visibility="{{ initResult &amp;&amp; initResult.google.isInitialized ? 'visible' : 'collapsed' }}"
tap="{{ loginWithGoogle }}" />

<Image src="~/img/linkedin.png"
visibility="{{ initResult &amp;&amp; initResult.linkedin.isInitialized ? 'visible' : 'collapsed' }}"
tap="{{ loginWithLinkedin }}" />

<GridLayout rows="auto,*" columns="*"
horizontalAlignment="stretch" verticalAlignment="stretch"
visibility="{{ loginResult ? 'visible' : 'collapsed' }}">
Expand Down Expand Up @@ -91,4 +95,4 @@
</TabViewItem>
</TabView.items>
</TabView>
</Page>
</Page>
Loading