Re: Issues with Visa In App Push Provisioning SDK and React Native -- iOS Module Creation

Issues with Visa In App Push Provisioning SDK and React Native -- iOS Module Creation

Hi Community,

 

I've been working through the VISA Digital Enablement SDK React-Native implementation guide to create iOS native modules so that we can use push provisioning to add our users cards to their apple wallet in our app -- we use React Native 0.68. I'm completing this project with our banking-as-a-service provider Unit.

I've added all the necessary frameworks and have copied the sample code for Objective-C for both a:

  • PushProvisioningModule.h file, and it's implementation in
  • PushProvisioningModule.mm

Both of which are living in iOS > project name (where AppDelegate lives). All of the SDK's frameworks (for example, VisaInAppModuleCore.xcframework) reside here as well.  These frameworks are all embedded & signed.

However, there are quite a few errors that pop up at compile time in my implementation file:

13 | RCTResponseSenderBlock successCallback;
14 | RCTResponseSenderBlock errorCallback;
> 15 | VisaPushProvisioningInterface *provisioningInterface;
| ^ unknown type name 'VisaPushProvisioningInterface'
16 | NSString *encPayload;
17 | }


It seems that the VisaPushProvisioningInterface type isn't recognized? Is there any clear reason why this would be the case?

Here's my implementation of the header file:

PushProvisioningModule.h

#import <Foundation/Foundation.h>
#import <React/RCTBridgeModule.h>
#import <VisaPushProvisioning/VisaPushProvisioning.h>
 
@interface PushProvisioningModule : NSObject <RCTBridgeModule>
@end


and of the implementation file, PushProvisioningModule.cc

#import <Foundation/Foundation.h>
#import "PushProvisioningModule.h"
 
 
@implementation PushProvisioningModule{
RCTResponseSenderBlock successCallback;
RCTResponseSenderBlock errorCallback;
VisaPushProvisioningInterface *provisioningInterface;
NSString *encPayload;
}
 
#pragma mark - Constants
NSString *const APPLE_WALLET_CODE = @"APPLE_PUSH_PROVISION";
 
#pragma mark - Module Interface Methods
// SDK Initialize
RCT_EXPORT_METHOD(launchInitialize: (NSString *) appID environment: (NSString *) environment  errorCallback: (RCTResponseSenderBlock) initErrCallback callback: (RCTResponseSenderBlock) initCallback){
 successCallback = initCallback;
errorCallback = initErrCallback;
NSString *myString = [[BaseService alloc] getMyString];
NSLog(myString);
 VPInitRequest *request = [[VPInitRequest alloc] initWithEnvironment:environment appId:appID otherInfo:NULL];  provisioningInterface = [[VisaPushProvisioningInterface alloc] initWithRequest:request listener:self];  [provisioningInterface initialize];
}
 
// Get Eligible Wallets
RCT_EXPORT_METHOD(launchGetWallets: (NSString *) encryptedPayload walletErrCallback:  (RCTResponseSenderBlock) walletErrCallback walletCallback: (RCTResponseSenderBlock) walletCallback){  successCallback = walletCallback;
errorCallback = walletErrCallback;
VPSupportedWalletRequest *request = [[VPSupportedWalletRequest alloc] initWithEncryptedPayload:  encryptedPayload];
[provisioningInterface getSupportedWalletsWithRequest:request];
}
 
 
// Start Card Provisioning
RCT_EXPORT_METHOD(launchStartCardProvisioning: (NSString *) walletDescription walletCode: (NSString *)  walletCode provisioningErrCallback: (RCTResponseSenderBlock) provisioningErrCallback provisioningCallback:  (RCTResponseSenderBlock) provisioningCallback){
successCallback = provisioningCallback;
errorCallback = provisioningErrCallback;
VPSupportedWalletCode code = VPSupportedWalletCodeAppleWallet;
if ([walletCode isEqualToString: APPLE_WALLET_CODE]) {
code = VPSupportedWalletCodeAppleWallet;
}
VPCardProvisioningRequest *request = [[VPCardProvisioningRequest alloc] initWithWalletCode:code];  dispatch_async(dispatch_get_main_queue(), ^{
[self ->provisioningInterface startCardProvisioningWithRequest:request
initialView:UIApplication.sharedApplication.delegate.window.rootViewController];
});
}
 
#pragma mark - VisaPushProvisioningListener Delegate methods
 // Initialization success result:
-(void)initializationSuccessWithPushProvisioningInterface:(VisaPushProvisioningInterface  *)pushProvisioningInterface response:(VPInitResponse *)response {
successCallback(@[[self getVPInitResponseDictionary:response]]);
}
// Initialization failure result:
-(void)initializationFailureWithPushProvisioningInterface:(VisaPushProvisioningInterface  *)pushProvisioningInterface error:(VPError *)error {
NSMutableDictionary *dictError = [self getVPErrorDictionary:error];
errorCallback(@[[self getStringFromDictionary:dictError]]);
}
 
// getSupportedWallets success result:
-(void)supportedWalletSuccessWithPushProvisioningInterface:(VisaPushProvisioningInterface  *)pushProvisioningInterface response:(VPSupportedWalletResponse *)response {
successCallback(@[[self getVPSupportedWalletResponse: response]]);
}
// getSupportedWallets failure result:
-(void)supportedWalletFailureWithPushProvisioningInterface:(VisaPushProvisioningInterface  *)pushProvisioningInterface error:(VPError *)error {
NSMutableDictionary *dictError = [self getVPErrorDictionary:error];
errorCallback(@[[self getStringFromDictionary:dictError]]);
}
// startCardProvisioning success result:
-(void)cardProvisioningSuccessWithPushProvisioningInterface:(VisaPushProvisioningInterface  *)pushProvisioningInterface response:(VPCardProvisioningResponse *)response {
successCallback(@[[self getVPCardProvisioningResponse:response]]);
}
// startCardProvisioning failure result:
-(void)cardProvisioningFailureWithPushProvisioningInterface:(VisaPushProvisioningInterface  *)pushProvisioningInterface error:(VPError *)error {
NSMutableDictionary *dictError = [self getVPErrorDictionary:error];
errorCallback(@[[self getStringFromDictionary:dictError]]);
}
 
 
 
 
// To export a module named PushProvisioningModule
RCT_EXPORT_MODULE()


And here are the frameworks we've got (as Unit provided via the Push Provisioning 3.0.1 iOS SDK)

Screen Shot 2022-10-03 at 10.46.37 AM.png


6 REPLIES 6

Re: Issues with Visa In App Push Provisioning SDK and React Native -- iOS Module Creation

A further detail, when I take a look at the framework's header files I see that VisaPushProvisioning.h seems incomplete. Is there a step here not mentioned in the guide that I need to take?

I didn't see any reference to the comment at the end of the file here while completing the set up guide. Is there something I'm missing?

 

/**
**© Copyright 2021 Visa. All Rights Reserved.**
*NOTICE: The software and accompanying information and documentation (together, the “Software”) remain the property of and are proprietary to Visa and its suppliers and affiliates. The Software remains protected by intellectual property rights and may be covered by U.S. and foreign patents or patent applications. The Software is licensed and not sold.*
 
*By accessing the Software you are agreeing to Visa's terms of use (developer.visa.com/terms) and privacy policy (developer.visa.com/privacy). In addition, all permissible uses of the Software must be in support of Visa products, programs and services provided through the Visa Developer Program (VDP) platform only (developer.visa.com). **THE SOFTWARE AND ANY ASSOCIATED INFORMATION OR DOCUMENTATION IS PROVIDED ON AN “AS IS,” “AS AVAILABLE,” “WITH ALL FAULTS” BASIS WITHOUT WARRANTY OR CONDITION OF ANY KIND. YOUR USE IS AT YOUR OWN RISK.** All brand names are the property of their respective owners, used for identification purposes only, and do not imply product endorsement or affiliation with Visa. Any links to third party sites are for your information only and equally do not constitute a Visa endorsement. Visa has no insight into and control over third party content and code and disclaims all liability for any such components, including continued availability and functionality. Benefits depend on implementation details and business factors and coding steps shown are exemplary only and do not reflect all necessary elements for the described capabilities. Capabilities and features are subject to Visa’s terms and conditions and may require development, implementation and resources by you based on your business and operational details. Please refer to the specific API documentation for details on the requirements, eligibility and geographic availability.*
 
*This Software includes programs, concepts and details under continuing development by Visa. Any Visa features, functionality, implementation, branding, and schedules may be amended, updated or canceled at Visa’s discretion. The timing of widespread availability of programs and functionality is also subject to a number of factors outside Visa’s control, including but not limited to deployment of necessary infrastructure by issuers, acquirers, merchants and mobile device manufacturers.*
*/

#import <Foundation/Foundation.h>

//! Project version number for VisaPushProvisioning.
FOUNDATION_EXPORT double VisaPushProvisioningVersionNumber;

//! Project version string for VisaPushProvisioning.
FOUNDATION_EXPORT const unsigned char VisaPushProvisioningVersionString[];

// In this header, you should import all the public headers of your framework using statements like #import <VisaPushProvisioning/PublicHeader.h>

 



 

Re: Issues with Visa In App Push Provisioning SDK and React Native -- iOS Module Creation

To see if it would resolve any of these issues, I've now instead tried going to swift way (the guide provides instructions to follow objective-c or swift implementation).

 

When pursuing a Swift implementation, I noticed that I was getting this error:

Failed to build module 'VisaPushProvisioning'; this SDK is not supported by the compiler (the SDK is built with 'Apple Swift version 5.3.2 (swiftlang-1200.0.45 clang-1200.0.32.28)', while this compiler is 'Apple Swift version 5.6.1 (swiftlang-5.6.0.323.66 clang-1316.0.20.12)'). Please select a toolchain which matches the SDK.


Per this stack overflow thread, it sounds like the Visa team may need to set a Build for Distribution setting to true?

I'm using the 3.0.1 SDK in case there is a later version available that I don't have access to?

jenn_kh
Community Moderator

Re: Issues with Visa In App Push Provisioning SDK and React Native -- iOS Module Creation

Thank you for reaching out, @DevinDeveloper! An agent is looking into this for you and will get back to you soon. Until then, if any community members know a solution, feel free to respond here. -Jenn

I_Doroteo3
Visa Developer Support Specialist

Re: Issues with Visa In App Push Provisioning SDK and React Native -- iOS Module Creation

Hi @DevinDeveloper

 

There is a V3.3.0;  to be able to assist you further, please submit an inquiry to developer@visa.com

 

Thanks, 

Illana

Re: Issues with Visa In App Push Provisioning SDK and React Native -- iOS Module Creation

Thanks Illana, 

I'll follow up with Unit to get a more recent version -- hopefully that resolve my issue here, but I'll follow up in this thread if not.

Appreciate the help!

I_Doroteo3
Visa Developer Support Specialist

Re: Issues with Visa In App Push Provisioning SDK and React Native -- iOS Module Creation

Hi @DevinDeveloper

 

I have been notified that the most up to date version for the iOS React Native Implementation Guide is v.3.0.1., so you are using the correct version.

 

The v3.3.0 that I referred to was for the SDK files on Visa Developer Portal.

 

I have privately messaged you asking for more information to ensure your issue is taken care of!

 

Thanks, 

Illana