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

Using "requireCordovaModule" to load non-cordova module "q" is not supported. Instead, add this module to your dependencies and use regular "require" to load it. #150

Open
Ruchika19021995 opened this issue Sep 4, 2020 · 2 comments

Comments

@Ruchika19021995
Copy link

Hello,

I am using app grouping (wants to navigate from option of my ios application side menu bar to an ionic application)

IOS Native Application I used this code for app-grouping:

let userDefaults = UserDefaults(suiteName: "group.com.ppp.XYS")

            let loginDictData = Utility.decodedData(key: Defaults[.userID]!) as Data
            let loginDictValue = NSKeyedUnarchiver.unarchiveObject(with: loginDictData)!
            let loginDictCheck = JSON.init(loginDictValue)
            
            let strUserName = loginDictCheck["username"].stringValue
            let strFirstName = loginDictCheck["firstname"].stringValue
            let strLastName = loginDictCheck["lastname"].stringValue
            let strUserId  = Defaults[.userID]!
            var strRoleName = ""
            if let role = loginDictCheck["userRole"].array{
                let dict = role[0].dictionaryValue
                if let roleName = dict["role"]!["rolename"].string{
                    strRoleName = roleName
                }
            }
            
            print(Defaults[.jSessionID]!)
            print(Defaults[.jSessionID]! + String.init(format: "; XSRF-TOKEN=%@; ", Defaults[.csrfToken]!) + Defaults[.AWSALBToken]!)
            let xsrfToken = Defaults[.jSessionID]! + String.init(format: "TOKEN=%@; ", Defaults[.csrfToken]!) + Defaults[.AWSALBToken]!
            userDefaults!.set(Defaults[.jSessionID]!, forKey: "JSESSION_Id")
            userDefaults!.set(xsrfToken, forKey: "TOKEN")
            userDefaults!.set(strUserName, forKey: "username")
            userDefaults!.set(strFirstName, forKey: "firstname")
            userDefaults!.set(strLastName, forKey: "lastname")
            userDefaults!.set(strUserId, forKey: "userID")
            userDefaults!.set(strRoleName, forKey: "rolename")
            userDefaults!.synchronize()
            
            application.open(appURL, options: [:], completionHandler: nil)
        }
        else{
            Toast(text:Utility.sharedInstance.getLanguageConvertedString(string: "ionic  application not found in your device")).show()
        }

then I want to use this plugin with this command on my ionic project:

$ ionic cordova plugin add cordova-plugin-app-preferences
$ npm install --save @ionic-native/app-preferences@4

But I am getting this error:

Using "requireCordovaModule" to load non-cordova module "q" is not supported. Instead, add this module to your dependencies and use regular "require" to load it.

@Ruchika19021995
Copy link
Author

Please revert me for the same I am in trouble

@Ruchika19021995
Copy link
Author

hello,

have you looked into the issue and have you find any update

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant