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

encrypt is undefined #9

Open
rajatSingh16 opened this issue Apr 30, 2020 · 4 comments
Open

encrypt is undefined #9

rajatSingh16 opened this issue Apr 30, 2020 · 4 comments

Comments

@rajatSingh16
Copy link

I have done
import AesCrypto from 'react-native-aes-kit'
I have also tried

import {NativeModules} from 'react-native'
const {AesCrypto} = NativeModules

But nothing seems to be working in IOS, however all the import and functions works on Android
I have done installing of pods too and podspec file also saved under react-native-aes-kit

@rajatSingh16
Copy link
Author

I resolved this problem, there is nothing wrong with imports I simply
### RCTAesCrypto.podspec file under react-native-aes-kit and the content of the file is
require 'json'

package = JSON.parse(File.read(File.join(dir, 'package.json')))

Pod::Spec.new do |s|
s.name = 'RCTAesCrypto'
s.version = package["version"]
s.summary = package["description"]
s.author = package["author"]

s.homepage = package["homepage"]

s.license = package["license"]
s.platform = :ios, "9.0"
s.tvos.deployment_target    = "11.0"
s.requires_arc              = true
s.source = { :git => "https://github.com/rocwangv/react-native-aes-kit.git", :tag => "#{s.version}" }
s.source_files ="ios/RCTAesCrypto/**/*.{h,m}"
s.preserve_paths =  'README.md', 'package.json', 'index.js'

s.dependency 'React'
end

@celciusjj
Copy link

Can you be more specific in the route path, i have same issue, please. Thank you

@rajatSingh16
Copy link
Author

rajatSingh16 commented May 8, 2020

You have to make a RCTAesCrypto.podspec under the directory react-native-aes-kit you can find this directory in node-modules important thing is is this line
s.source_files ="ios/RCTAesCrypto/**/*.{h,m}" which tells where to look for .m and .h files
make sure to replace dir with __dir__

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

3 participants