-
Notifications
You must be signed in to change notification settings - Fork 59
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
BlinkID is undefined #34
Comments
OK as an update, I am still working on this. It turns out it only got as far as the build because I removed BlinkID from the Linked Frameworks and Libraries - hence it was undefined. I did this because I cannot get it to build with BlinkID included. I get the error I have tried many many things to get round this issue. https://stackoverflow.com/a/41488258 looked promising but didn't work. I've tried adding various things to Header Search Paths. Nothing has got it to build. Any advice on what to try next? There's a bit of time pressure so if I'm not able to get this working soon I will need to use another library. |
Hi @JEGardner, |
Hi @lirfu, thanks for the reply. I think they've been added automatically. Here's a screenshot of my Header Search Paths. I'm not very experienced with iOS development, does anything look wrong? |
Hi @JEGardner, what version of react-native are you using? Kind regards, |
Hi Jure, thanks for your reply. I'm using Expo's archived React Native version sdk-24.0.0, which is React Native version 0.51. I can see BlinkIDReactNative.xcodeproj is under Libraries, so I think that's correct. Any ideas what I could try to make the BlinkIDReactNative find the react-native headers? |
Hi @JEGardner you can try adding these two paths to the header search path in BlinkIDReactNative targets build phase:
Here I'm assuming that node-modules folder is not different than the one in our demo app. Have you tried running our demo app and does it work for you, you can build it with Kind regards, |
Hello there, I am experiencing the same issue.. The only thing that i can think of that broke it upgrading to 0.51 RN.. Was working before.. @JEGardner did you manage to get it working again.. Im getting this error.. |
Hi @unicornRainbows, did you also eject your app or you initialised it like we initialise our demo app using react-native init? Kind regards, |
Hello @cularj I did and it was working previously. :) When i log the keys from the import i get the correct values, but logging BlinkID give me undefined. Then i do a react-native link blinkid-react-native and get the So the only way I get the app to build is by unlinking blinkid-react-native but then I am back at square one regarding BlinkID returning undefined. |
Hi @unicornRainbows, @JEGardner
Note that this target doesn't have PODS_ROOT defined so you will need to add that too. Just click on the plus, left of the search bar, and choose add user-defined setting.
This makes it a bit cleaner. |
Thanks very much @cularj. I am working together with @unicornRainbows on this issue and that helped! I just wanted to say that our app is not ejected from expo, but it is using React via Pods: pod 'React', path: '../node_modules/react-native', subspecs: [
...
] So I think your advice applies to all projects which pull React as a pods dependency, not just ejected apps. Should we update the README? |
Also, while we're on the README, which version of PPBlinkID is it safe to use with v While we were having these issues we tried upgrading to latest Is it safe to update the README with |
@cularj I realised that for this to work in our project, I needed to make changes to In this state it won't work for any non-pods projects, but for reference here is the commit. Do you know how other projects do it, where they support React as both a Pod dependency, or as a direct project library? |
This is the way
Looks like they just reference both ways the react headers could be reached. Are you happy if I take a stab at a PR @cularj? |
Sure, but those search paths won't work with blinkid-react-native, because the xcode project is in node-modules/blinkid-react-native/src/ios so it would need a bit more tweaking I think. |
Hi @naartjie @unicornRainbows, |
Hi @cularj Can you help me how can I solve this issue. What is the reason of that? |
@cularj Awesome. I've taken
Also, just to clarify again, we're not using an ejected setup (we were never using Expo), we're just using React via CocoaPods, so it might be worthwhile mentioning it in the README, although now that it's been fixed, people shouldn't be having issues regardless if React is a lib in their project or if it's being pulled in via pods, it should work seamlessly either way ;-) Thanks again. |
@JEGardner, if you can confirm the issue is gone on your side, this can be closed. |
@cularj @naartjie My app environment is: Error message: Thanks in advance! |
Hi @LoongerBuxus Try removing Since you stated that you created your project using react-native init I'm guessing React is added as an xcodeproject in that case you should add following to your header search paths:
Otherwise specifying PODS_ROOT and adding Kind regards, |
@cularj Thanks for your reply. React is in Libraries added as a xcodeproject. So I removed the
But this didn't solve the problem. |
I think I found where the problem is, the entry for BlinkIDReactNative in the headers search path of the main target was corrupt. I have corrected it and it now works. |
Hi, I recently ejected from Expo to Expokit to try out BlinkID. Running into an issue where BlinkID is undefined when I import it. I know... most common error, so it's hard for you guys to help me out, however I followed the instructions, it's building successfully through XCode.
If I do this to see everything exported:
import * as BlinkID from 'blinkid-react-native'
then console log BlinkID, I get this:
Object { "BlinkID": undefined, "EUDLKeys": Object { "Address": "ownerAddress", "BirthData": "ownerBirthData", "DriverNumber": "driverNumber", "ExpiryDate": "documentExpiryDate", "FirstName": "ownerFirstName", "IssueDate": "documentIssueDate", "IssuingAuthority": "documentIssuingAuthority", "LastName": "ownerLastName", }, "MRTDKeys": Object { "AlienNumber": "AlienNumber", "ApplicationReceiptNumber": "ApplicationRecieptNumber", "DateOfBirth": "DateOfBirth", "DateOfExpiry": "DateOfExpiry", "DocumentCode": "DocumentCode", "DocumentNumber": "DocumentNumber", "ImmigrantCaseNumber": "ImmigrantCaseNumber", "Issuer": "Issuer", "MRZText": "MRTDRaw", "Nationality": "Nationality", "Opt1": "Opt1", "Opt2": "Opt2", "PrimaryId": "PrimaryId", "SecondaryId": "SecondaryId", "Sex": "Sex", }, "MYKADKeys": Object { "Address": "ownerAddress", "AddressCity": "ownerAddressCity", "AddressState": "ownerAddressState", "AddressStreet": "ownerAddressStreet", "AddressZipCode": "ownerAddressZipCode", "DateOfBirth": "ownerBirthDate", "FullName": "ownerFullName", "NricNumber": "nricNumber", "Religion": "ownerReligion", "Sex": "ownerSex", }, "PDF417Keys": Object { "BarcodeData": "BarcodeData", }, "USDLKeys": Object { "AKADateOfBirth": "Alias / AKA Date of Birth", "AKAFamilyName": "Alias / AKA Family Name", "AKAFullName": "Alias / AKA Name", "AKAGivenName": "Alias / AKA Given Name", "AKAMiddleName": "Alias / AKA Middle Name", "AKAPrefixName": "Alias / AKA Prefix Name", "AKASocialSecurityNumber": "Alias / AKA Social Security Number", "AKASuffixName": "Alias / AKA Suffix Name", "AddressCity": "Address - City", "AddressJurisdictionCode": "Address - Jurisdiction Code", "AddressPostalCode": "Address - Postal Code", "AddressStreet": "Address - Street 1", "AddressStreet2": "Address - Street 2", "AuditInformation": "Audit information", "CardRevisionDate": "Card Revision Date", "Code128": "kPPCode128", "Code39": "kPPCode39", "ComplianceType": "Compliance Type", "CountryIdentification": "Country Identification", "CustomerFamilyName": "Customer Family Name", "CustomerFirstName": "Customer First Name", "CustomerFullName": "Customer Name", "CustomerIdNumber": "Customer ID Number", "CustomerMiddleName": "Customer Middle Name", "DataDiscriminator": "Data discriminator", "DateOfBirth": "Date of Birth", "DocumentDiscriminator": "Document Discriminator", "DocumentExpirationDate": "Document Expiration Date", "DocumentExpirationMonth": "Document Expiration Month", "DocumentIssueDate": "Document Issue Date", "DocumentNonexpiring": "Document Nonexpiring", "DocumentType": "Document Type", "EyeColor": "Eye Color", "FamilyNameTruncation": "Family name truncation", "FederalCommercialVehicleCodes": "Federal Commercial Vehicle Codes", "FirstNameTruncation": "First name truncation", "FullAddress": "Full Address", "HAZMATExpirationDate": "HAZMAT Endorsement Expiration Date", "HairColor": "Hair color", "Height": "Height", "HeightCm": "Height cm", "HeightIn": "Height in", "InventoryControlNumber": "Inventory control number", "IssueTimestamp": "Issue Timestamp", "IssuerIdentificationNumber": "Issuer Identification Number", "IssuingJurisdiction": "Issuing jurisdiction", "IssuingJurisdictionName": "Issuing jurisdiction name", "JurisdictionEndorsementCodes": "Jurisdiction-specific endorsement codes", "JurisdictionEndorsmentCodeDescription": "Jurisdiction-specific endorsment code description", "JurisdictionRestrictionCodeDescription": "Jurisdiction-spacific restriction code description", "JurisdictionRestrictionCodes": "Jurisdiction-specific restriction codes", "JurisdictionVehicleClass": "Jurisdiction-specific vehicle class", "JurisdictionVehicleClassificationDescription": "Jurisdiction-specific vehicle classification description", "JurisdictionVersionNumber": "Jurisdiction Version Number", "LimitedDurationDocument": "Limited Duration Document Indicator", "MedicalIndicator": "Medical Indicator/Codes", "MiddleNameTruncation": "Middle name truncation", "NamePrefix": "Name Prefix", "NameSuffix": "Name Suffix", "NonResident": "Non-Resident Indicator", "NumberOfDuplicates": "Number of Duplicates", "OrganDonor": "Organ Donor Indicator", "Pdf417": "kPPPdf417", "PermitExpirationDate": "Driver Permit Expiration Date", "PermitIdentifier": "Permit Identifier", "PermitIssueDate": "Driver Permit Issue Date", "PlaceOfBirth": "Place of birth", "RaceEthnicity": "Race / ethnicity", "ResidenceCity": "Driver Residence City", "ResidenceFullAddress": "Driver Residence Full Address", "ResidenceJurisdictionCode": "Driver Residence Jurisdiction Code", "ResidencePostalCode": "Driver Residence Postal Code", "ResidenceStreetAddress": "Driver Residence Street Address", "ResidenceStreetAddress2": "Driver Residence Street Address 2", "SecurityVersion": "Security Version", "Sex": "Sex", "SocialSecurityNumber": "Social Security Number", "StandardEndorsementCode": "Standard endorsement code", "StandardRestrictionCode": "Standard restriction code", "StandardVehicleClassification": "Standard vehicle classification", "StandardVersionNumber": "Standard Version Number", "Under18": "Under 18 Until", "Under19": "Under 19 Until", "Under21": "Under 21 Until", "UniqueCustomerId": "Unique Customer Identifier", "Veteran": "Veteran Indicator", "WeightKilograms": "Weight (kilograms)", "WeightPounds": "Weight (pounds)", "WeightRange": "Weight Range", }, }
So as you can see everything's ok except for BlinkID which is undefined. Also get undefined from
console.log(NativeModules.BlinkIDReactNative)
.I'm going to continue to investigate, however do you have any suggestions? I've not added a Native Module to React Native before so not sure where to look next.
The text was updated successfully, but these errors were encountered: