Re: Push Provisioning iOS SDK & React Native -- sample code/documentation is contradictory and i

Push Provisioning iOS SDK & React Native -- sample code/documentation is contradictory and incorrect

I've been working through Visa In-App Push Provisioning guide for React Native --

The two sets of docs suggest two different initialization methods that are completely different from each other. Unfortunately, neither works.

In 'How to Create React Native App for Visa In-App Provisioning SDK' it suggests the below implementation (we will call version A):

 

#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]; 

}

 

 

This seems great (maybe getMyString was left by accident, but that's okay we can remove that) however it cannot be run because VPInitRequest is not actually defined in the SDK (!). 

So, I have instead tried what's recommended by 'Visa Digital Enablement Software Developer Kit (VDE SDK)
React-Native Implementation Guide' (we will call version B):

// SDK Initialize
RCT_EXPORT_METHOD(launchInitialize: (RCTResponseSenderBlock) initErrCallback callback:
(RCTResponseSenderBlock) initCallback){
successCallback = initCallback;
errorCallback = initErrCallback;
provisioningInterface = [VisaPushProvisioningInterfaceFactory
createPushProvisioningInterfaceWithListener: self];
[provisioningInterface initialize];
}

 
This one at least compiles, but, as you would suspect given several arguments are not included, you get the below error upon initialization:

{"code":"VP_ERROR_101","correlationId":"[redacted]","description":"SDK initialization failed due to empty App Id.","type":"EmptyAppId"}


Of course upon receiving this error I again try to get the (Version A) working but of course it doesn't work because the file VisaPushProvisioning-Swift.h does not actually declare VPInitRequest. It does declare VPInitResponse (see below), so it's really really interesting that VPInitRequest is omitted.

/// A response model class with signedNonce string variable. signedNonce value to be used to encrypt the card informaion
SWIFT_CLASS("_TtC20VisaPushProvisioning14VPInitResponse")
@interface VPInitResponse : NSObject
/// Nonce value to be used by issuer, to encrypt card informaion
@property (nonatomic, readonly, copy) NSString * _Nonnull signedNonce;
- (nonnull instancetype)initWithSignedNonce:(NSString * _Nonnull)signedNonce OBJC_DESIGNATED_INITIALIZER;
- (NSString * _Nullable)toJsonString SWIFT_WARN_UNUSED_RESULT;
- (nonnull instancetype)init SWIFT_UNAVAILABLE;
+ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
@end

 

Does anyone have any clarity on:

  • Which set of documentation should be followed for React Native - iOS Visa In-App Push Provisioning?
    • Since they all contradict, it would be great to know which is the latest/which should be followed (I've been picking and choosing to just get it to compile)
    • Would love to know the same for Android
  • Is there not a more recent version of the iOS SDK somewhere? I have been provided VisaInAppSDK-3.0.1-ios.zip (it seems incomplete based off the above)
    • For Android I've been provided a VisaInAppSDK-3.0.0-android.zip
4 REPLIES 4
jenn_kh
Community Moderator

Re: Push Provisioning iOS SDK & React Native -- sample code/documentation is contradictory and i

Thank you for your questions, @DevinDeveloper. An agent will get back to you as soon as possible. In the meantime, if any community member has any information that may be helpful, please reply here! -Jenn

I_Doroteo3
Visa Developer Support Specialist

Re: Push Provisioning iOS SDK & React Native -- sample code/documentation is contradictory and i

Hi @DevinDeveloper

 

Per our communication from your other Community post regarding the React Native VIAP SDK, please reach out to Unit directly regarding issues with your implementation.

 

Thanks, 

Illana

Re: Push Provisioning iOS SDK & React Native -- sample code/documentation is contradictory and i

I've asked Unit and they've forwarded the question to their contact at Visa support but it seems the Visa support they're interfacing with takes a really long time to respond. 

Is it okay for me to leave this thread up in case someone in the community is able to help? Or do I need to delete this post?

I_Doroteo3
Visa Developer Support Specialist

Re: Push Provisioning iOS SDK & React Native -- sample code/documentation is contradictory and i

Hi Devin, 

 

You may keep the post up - no need to delete.

 

Thanks, 

Illana