primer-io / primer-sdk-ios Goto Github PK
View Code? Open in Web Editor NEWiOS SDK for Primer
License: MIT License
iOS SDK for Primer
License: MIT License
Hi guys,
Recently, I've spent lots of time debugging PrimerSDK
due to a mysterious case when the native PKPaymentAuthorizationViewController
was not shown on the device. The problem was caused by the wrong merchantIdentifier
(not the same as in the certificate). But the problem is not apparent, and you have to spend time to detect that the error is inside PKPaymentAuthorizationViewController
from PassKit.framework
The investigating process highlighted that you use PKPaymentAuthorizationViewController
in ApplePayTokenizationViewModel.swift
, but starting iOS10 (as I see from the Package.swift
, it's your min deployment target) there is a new recommended way from Apple to use PKPaymentAuthorizationController
Why to use?
PrimerUIManager.primerRootViewController?.present(paymentVC, animated: true, completion: {
DispatchQueue.main.async {
PrimerDelegateProxy.primerHeadlessUniversalCheckoutUIDidShowPaymentMethod(for: self.config.type)
self.didPresentPaymentMethodUI?()
seal.fulfill()
}
})
UIWindowScene
in static func prepareRootViewController()
(PrimerUIManager.swift
) because the PKPaymentAuthorizationController
is shown by Apple's framework inner logic. And it's guaranteed to be at the top of the hierarchylet paymentVC = PKPaymentAuthorizationController(paymentRequest: request)
paymentVC.present { success in
if success {
print("Presented payment controller")
} else {
print("Failed to present payment controller")
}
}}
PassKit.framework
but not your own.UKit
independent future (for example, for MacOS or WatchOS or just SwiftUI usage)primer sdk: 2.15.0
xcode: 13.2.1 (upgrading to 14 isn't viable right now)
[Transporter Error Output]: ERROR ITMS-90535: Unexpected CFBundleExecutable Key. The bundle at 'Payload/BRICK.app/PrimerResources.bundle' does not contain a bundle executable. If this bundle intentionally does not contain an executable, consider removing the CFBundleExecutable key from its Info.plist and using a CFBundlePackageType of BNDL. If this bundle is part of a third-party framework, consider contacting the developer of the framework for an update to address this issue.
sdk version: 2.11.1
xcode: 13.2.1
device: simulator, iphone 12, ios 15.2
react native sdk: 2.11.0
react native version: 0.66.4
I'm posting it here since the error seems to be in the ios code. It works fine on android.
I am trying to vault paypal payment method (create billing agrement) using either showPaymentMethod or showVaultManager. The flow seemingly works fine until it reaches the end, where nothing happens once I am returned to the app from the paypal page.
I poked around a bit in your code and it looks like PayPalService is instantly deinitialized, which means that paypalTokenId is nil.
Logged what's happening
// showPaymentMethod:
🧨 start startBillingAgreementSession
🧨 deinit
🧨 success startBillingAgreementSession
🧨 config.tokenId: BA-4S778055VB884092R
🧨 self?.paypalTokenId: nil
// after paypal flow finished:
🧨 start confirmBillingAgreement
// nothing seems to happen here with the error for missing value paypalTokenId. No error is logged or event received by my error handler.
🧨 deinit
Hello,
I hope this message finds you well. I am writing to report an issue related to the PrimerInputElementDelegate
in the Primer repository.
When utilizing the PrimerInputElementDelegate protocol and implementing the method @objc optional func inputElementValueDidChange(_ sender: PrimerHeadlessUniversalCheckoutInputElement)
, I have observed that this method is never triggered, despite other methods working as expected.
I have thoroughly reviewed my implementation and ensured that I am conforming to the protocol correctly. However, it seems that the inputElementValueDidChange
method is not being called when it should be.
I have checked for any relevant documentation or discussions regarding this behavior but haven't found a resolution. If there are any additional steps or considerations specific to this method, please let me know.
I appreciate your assistance in resolving this matter. If further information or code samples are needed, please don't hesitate to ask.
Thank you for your time and support.
On completion when returning to app, i get this error. I looked a bit at the code and it seems like for the billing agreement session there is no orderId set in "PayPalTokenizationViewModel", but "generatePaypalPaymentInstrument()" is called which uses it.
{
recoverySuggestion: 'Check if value nil is valid for key orderId',
description: '[invalid-value] Invalid value \'nil\' for key \'orderId\'',
errorId: 'PrimerSDK.PrimerError'
}
There is an actual problem with building PrimerSDK 2.17.5 installed via SPM using Xcode 15 (15A240d)
Mock3DSService fails to compile due to a lack of import of the UIKit framework.
Adding import UIKit
to line #9 in Mock3DSService.swift
fixes the issue.
Please add this fix to the next build
In your .podspec
file, you have an xcconfig
hash - these properties get merged into the consuming project's .xcconfig
file and with the values MARKETING_VERSION
and CODE_SIGNING_ALLOWED = NO
they currently disable code signing through Fastlane's gym
and xcodebuild
but also override our marketing version.
You should be using https://guides.cocoapods.org/syntax/podspec.html#pod_target_xcconfig to ensure these properties don't make their way into the consuming project.
Hello, im following this Quick Start.
Im using CocoaPods and PrimerSDK 1.5.2v
also i provided the -PrimerDebugEnabled in the arguments
When i send client token on this place
func clientTokenCallback(_ completion: @escaping (Result<String, Error>) -> Void) {
// primerToken i getting from another place
completion(.success(primerToken))
}
i have an error:
[strings] Unable to load .strings file: CFBundle 0x7fb3b3dd0ee0 </Users/test/Library/Developer/CoreSimulator/Devices/0EC2A93D-8728-4877-9FF0/data/Containers/Bundle/Application/BFA7D448-0161-4DB5-983E/Test Project.app/Frameworks/PrimerSDK.framework/PrimerResources.bundle> (not loaded) / Localizable: Error Domain=NSCocoaErrorDomain Code=3840 "Unexpected character / at line 1" UserInfo={NSDebugDescription=Unexpected character / at line 1, kCFPropertyListOldStyleParsingError=Error Domain=NSCocoaErrorDomain Code=3840 "Missing ';' on line 344" UserInfo={NSDebugDescription=Missing ';' on line 344}}
URL scheme & scheme identifier are missing from the settings.
Testing the issue
Hi 🙂, i have some problem with SDK (pod 'PrimerSDK', '= 2.3.0')
Unable to set custom schema, because schema is injected into dependency container in PrimerSettings, but gets according to the protocol PrimerThemeProtocol. As a result, it always initializes an empty schema and adds dependencies to the package.
I have some fix for this bug
`public func configure(settings: PrimerSettings? = nil, delegate: PrimerDelegate? = nil) {
DependencyContainer.register((settings ?? PrimerSettings()) as PrimerSettingsProtocol)
DependencyContainer.register((settings ?? PrimerSettings()).uiOptions.theme as PrimerThemeProtocol)
self.delegate = delegate
}`
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.