recognizegroup / capacitor-plugin-msauth

Capacitor-wrapper for MSAL libraries. Works on iOS, Android and web.
Other
17 stars 17 forks source link

Build Error: Cannot find 'MsAuthPlugin' in scope #7

Closed Jeff-Stapleton closed 1 year ago

Jeff-Stapleton commented 1 year ago

I installed the package via npm

npm install @recognizebv/capacitor-plugin-msauth

Then I added the keychain group

Screen Shot 2022-10-20 at 2 11 59 PM

Updated the info.plist

    <key>CFBundleURLTypes</key>
    <array>
        <dict>
            <key>CFBundleURLSchemes</key>
            <array>
                <string>msauth.$(PRODUCT_BUNDLE_IDENTIFIER)</string>
            </array>
        </dict>
    </array>
    <key>LSApplicationQueriesSchemes</key>
    <array>
        <string>msauthv2</string>
        <string>msauthv3</string>
    </array>

Updated the AppDelegate.swift

    func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey: Any] = [:]) -> Bool {
        // Called when the app was launched with a url. Feel free to add additional processing here,
        // but if you want the App API to support tracking app url opens, make sure to keep this call
        if MsAuthPlugin.checkAppOpen(url: url, options: options) == true {
            return true
        }
        return ApplicationDelegateProxy.shared.application(app, open: url, options: options)
    }

I build the app, run npx cap sync and npx cap open ios but in xcode when I try to run the app AppDelegate throws an error "Cannot find 'MsAuthPlugin' in scope

bartwesselink commented 1 year ago

Hi @Jeff-Stapleton! Could you try adding import RecognizebvCapacitorPluginMsauth to the top of the AppDelegate.swift?

I will update the readme accordingly.

Jeff-Stapleton commented 1 year ago

Hi @Jeff-Stapleton! Could you try adding import RecognizebvCapacitorPluginMsauth to the top of the AppDelegate.swift?

I will update the readme accordingly.

Yup, it was as simple as that! Thank you for the reply and the help!