Skip to content
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

[Bug]: Error: "IDnow" plugin is not implemented on ios #7428

Closed
1 of 3 tasks
mrsamse opened this issue Apr 24, 2024 · 1 comment
Closed
1 of 3 tasks

[Bug]: Error: "IDnow" plugin is not implemented on ios #7428

mrsamse opened this issue Apr 24, 2024 · 1 comment
Labels

Comments

@mrsamse
Copy link

mrsamse commented Apr 24, 2024

Capacitor Version

Latest Dependencies:

@capacitor/cli: 6.0.0
@capacitor/core: 6.0.0
@capacitor/android: 6.0.0
@capacitor/ios: 6.0.0

Installed Dependencies:

@capacitor/cli: 6.0.0
@capacitor/core: 6.0.0
@capacitor/android: 6.0.0
@capacitor/ios: 6.0.0

[success] iOS looking great! 👌
[success] Android looking great! 👌

Other API Details

No response

Platforms Affected

  • iOS
  • Android
  • Web

Current Behavior

I have implemented my own plugin for capacitor, which I only use in a single app. So the plugin is integrated in the app itself and is not installed via npm.

After upgrading from capactior 5 to 6 I get now this error message in the logs:
Error: "IDnow" plugin is not implemented on ios

(IDnow is the name of my plugin)

I didn't change anything in the plugin code and the plugin works fine on android. And If I switch back to capacitor 5, the plugin works fine again.

Has anything changed for custom plugins on iOS?

Expected Behavior

My plugin should work with capactior 5 and 6 without changing the plugin code.

Project Reproduction

Question without reproduction

Additional Information

Content of IDnowPlugin.m:

#import <Foundation/Foundation.h>
#import <Capacitor/Capacitor.h>

CAP_PLUGIN(IDnowPlugin, "IDnow",
  CAP_PLUGIN_METHOD(startIdent, CAPPluginReturnPromise);
)

Content of IDnowPlugin.swift:

import Foundation
import Capacitor
import IDNowSDKCore

@objc(IDnowPlugin)
public class IDnowPlugin: CAPPlugin {

    @objc public func startIdent(_ call: CAPPluginCall) {
        let ident: String = call.getString("ident") ?? ""
        let language: String = call.getString("language") ?? ""
        let controller: UIViewController = self.bridge!.viewController!
        
        
        IDNowSDK.shared.start(token: ident, preferredLanguage: language, fromViewController: controller, listener:{(result: IDNowSDK.IdentResult.type, statusCode: IDNowSDK.IdentResult.statusCode, message: String) in
            if result == .ERROR {
                call.reject("Error", String(statusCode.rawValue))
            } else if result == .CANCELLED {
                call.reject("Cancelled", String(statusCode.rawValue))
            } else if result == .FINISHED {
                call.resolve()
            }
        })

    }
}

I followed those 2 guides for the plugin implementation:
https://capacitorjs.com/docs/ios/custom-code
https://capacitorjs.com/docs/plugins/tutorial/ios-implementation

@mrsamse mrsamse added the triage label Apr 24, 2024
@jcesarmobile
Copy link
Member

duplicate of ionic-team/capacitor-docs#275

@jcesarmobile jcesarmobile closed this as not planned Won't fix, can't repro, duplicate, stale Apr 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants