Skip to content

Commit

Permalink
feat(ios-aswebauthenticationsession): add plugin (#3421)
Browse files Browse the repository at this point in the history
* feat(ios-aswebauthenticationsession): add plugin

* Update index.ts

* returning string instead of any

Co-authored-by: Daniel Sogl <daniel@sogls.de>
  • Loading branch information
philkry and danielsogl authored Jun 11, 2020
1 parent 79c3284 commit 742ff65
Showing 1 changed file with 49 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import { Injectable } from '@angular/core';
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';

/**
* @name ios-aswebauthenticationsession-api
* @description
* Plugin for iOS 12 ASWebAuthenticationSession API
*
* @usage
* ```typescript
* import { IosASWebauthenticationSession } from '@ionic-native/ios-aswebauthenticationsession-api/ngx';
*
*
* constructor(private IosASWebauthenticationSession: ios-aswebauthenticationsession-api) { }
*
* ...
*
*
* this.IosASWebauthenticationSession.start(callbackUrl, authorizeURL)
* .then((redirectUrl: string) => console.log(redirectUrl))
* .catch((error: any) => console.error(error));
*
* ```
*/

@Plugin({
pluginName: 'IosASWebauthenticationSession',
plugin: 'cordova-plugin-ios-aswebauthenticationsession-api',
pluginRef: 'plugins.ASWebAuthSession',
repo:
'https://github.com/jwelker110/cordova-plugin-ios-aswebauthenticationsession-api',
platforms: ['iOS'],
})
@Injectable()
export class IosASWebauthenticationSession extends IonicNativePlugin {
/**
* This function start an authentication flow in ASWebauthenticationSession
* @param callbackUrl {string} Callback URL of your App
* @param authorizeURL {number} Authorization URL
* @return {Promise<string>} Returns a promise that resolves a string containing the redirect URL after finishing ASWebauthenticationSession
*/
@Cordova()
start(
callbackUrl: string,
authorizeURL: string
): Promise<string> {
return;
}
}

0 comments on commit 742ff65

Please sign in to comment.