apphud / apphudsdk Goto Github PK
View Code? Open in Web Editor NEWBuild, Measure and Grow iOS subscription business
Home Page: https://apphud.com
License: MIT License
Build, Measure and Grow iOS subscription business
Home Page: https://apphud.com
License: MIT License
Hey! I am trying to test deferred purchases. When I click the Buy button, I see the "Ask Permission" alert, when I click "Cancel" or "Ask", nothing happens, the ApphudDelegate does not fire and my activityIndicator is visible always. I have to process these purchases in func paymentQueue (_ queue: SKPaymentQueue, updatedTransactions transactions: [SKPaymentTransaction]) {}
How do I know if a deferred purchase has been used through the ApphudDelegate?
Please add delegate methods for errors in API calls because it's completely not transparent when and why these issues happen.
I.e. when paywalls/products cannot be loaded.
I open example project, select StoreKitApphudSDKDemo, build project and in console see err:
[Apphud] Failed to load SKProducts from the App Store, because product identifiers are invalid:
["com.apphud.gold", "com.apphud.monthly_promo"]
and what i see in simulator
https://ibb.co/17ZJfPQ
How can i fix it?
Hi!
I try to get SKProducts from ApphudProduct, but got nil in iPhone SE 14.4, before all worked fine.
My steps:
Apphud.paywallsDidLoadCallback { paywalls in
// retrieve default paywall
let paywall = paywalls.first(where: { $0.isDefault })
var products: [ApphudProduct] = []
// retrieve the products [ApphudProduct] from current paywall
if let paywall = paywall {
products = paywall.products
for product in paywall.products {
print("test:", product.productId, product.skProduct)
}
}
}
what i get: "test: com.kushman.nevergame.annual nil", but in other simulators, like iPhone 13 pro max 15.2 i got: "com.kushman.nevergame.annual Optional(<SKProduct: 0x600002905270>)"
Can u help me?
because of the max number of attempts Apphud will give up on trying to register user and fetch products.
I use refreshStoreKitProducts
to force it but with SwiftUI it's a bit awkward.
I think there shouldn't be a limit, also 30+ seconds retry is too much to wait for the user if he goes online.
I understand that you try to reduce load on your servers but there is no load if there's no connection. Maybe you should check the error generated by the request.
"Apphud SDK requires minimum iOS 11.2" - are you serious?
My application supports iOS 9 and above, for the sake of your SDK I will not raise the "Deployment Target" version. Since I have many clients on iOS 9 and 10.
How can I use the SDK and your service now?
how to set the price for subscriptions of the product in apphud sdk dasbordbord
In sandbox after succesing buy non-renewing purchase, i don't see an active purchases.
[12:15:06 PM] [Apphud] Failed to load SKProducts from the App Store, error: Error Domain=SKErrorDomain Code=0 "UNKNOWN_ERROR" UserInfo={NSLocalizedDescription=UNKNOWN_ERROR, NSUnderlyingError=0x6000008b4870 {Error Domain=ASDErrorDomain Code=507 "Error decoding object" UserInfo={NSLocalizedDescription=Error decoding object, NSLocalizedFailureReason=Attempted to decode store response}}}
Yes, there's a callback but it's not obvious that productsDidFetchCallback
is broken after you call refreshStoreKitProducts
Hi!
When i refnding purchase in storeKit manager i expect that delegate will called, but nothing to happening.
In explanation of this method written: "Called when any of non renewing purchases changes. Called when purchase is made or has been refunded."
May be i don't understand somthink?
Can you make a sample one? How will we list the products?
Hello! Thank you for great service!
Do you plan to add MacOS support to the SDK?
I add SPM library to MacOs target, but the application is not building.
I made the purchase on the simulator, and they showed up in the Manage Transaction Window, but it didn't appear on the simulator. Sometimes, Apphud displayed a Refunded subscription, but I didn't find a pattern. For some reason, it sometimes appeared.
The error is reproduced many times in the simulator when purchasing any subscriptions.
Started to appear after updating from 3.2.8 to 3.3.2.
My guess is that storeKitProductsFetchedCallbacks
can get the same callback twice, somehow.
The stacktrace is always the same for us, we call only Apphud.placement
on our paywall appear/disappear
Crashed: com.apple.main-thread
0 libswiftCore.dylib 0x383fc _assertionFailure(_:_:file:line:flags:) + 264
1 libswift_Concurrency.dylib 0x5824 CheckedContinuation.resume(returning:) + 504
2 ArtWorkout 0x3e1118 closure #1 in closure #1 in static Apphud.placements(maxAttempts:) + 4381184280
3 ArtWorkout 0x3e9958 partial apply for closure #1 in closure #1 in static Apphud.paywalls(maxAttempts:) + 4381219160
4 ArtWorkout 0x3a2be4 closure #1 in closure #1 in ApphudInternal.fetchOfferingsFull(maxAttempts:callback:) + 255 (ApphudInternal+Product.swift:255)
5 ArtWorkout 0x3a6f6c partial apply for thunk for @escaping @callee_guaranteed (@guaranteed ApphudError?) -> () + 4380946284 (<compiler-generated>:4380946284)
6 ArtWorkout 0x39f99c ApphudInternal.performAllStoreKitProductsFetchedCallbacks(error:) + 43 (ApphudInternal+Product.swift:43)
7 ArtWorkout 0x3a4c9c specialized ApphudInternal.handleDidFetchAllProducts(storeKitProducts:error:) + 128 (ApphudInternal+Product.swift:128)
8 libswift_Concurrency.dylib 0x41ac4 swift::runJobInEstablishedExecutorContext(swift::Job*) + 436
9 libswift_Concurrency.dylib 0x42d54 swift_job_runImpl(swift::Job*, swift::ExecutorRef) + 72
10 libdispatch.dylib 0x128a8 _dispatch_main_queue_drain + 744
11 libdispatch.dylib 0x125b0 _dispatch_main_queue_callback_4CF + 44
12 CoreFoundation 0x3701c __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 16
13 CoreFoundation 0x33d28 __CFRunLoopRun + 1996
14 CoreFoundation 0x33478 CFRunLoopRunSpecific + 608
15 GraphicsServices 0x34f8 GSEventRunModal + 164
16 UIKitCore 0x22c62c -[UIApplication _run] + 888
17 UIKitCore 0x22bc68 UIApplicationMain + 340
18 UIKitCore 0x4563d0 __swift_destroy_boxed_opaque_existential_1Tm + 12220
19 ArtWorkout 0x26e84 main + 4377276036 (AppDelegate.swift:4377276036)
20 ??? 0x1c7e56dcc (Missing)
Hey! I am trying to test deferred purchases. When I click the Buy button, I see the "Ask Permission" alert, when I click "Cancel" or "Ask", nothing happens, the ApphudDelegate does not fire and my activityIndicator is visible always. I have to process these purchases in func paymentQueue (_ queue: SKPaymentQueue, updatedTransactions transactions: [SKPaymentTransaction]) {}
How do I know if a deferred purchase has been used through the ApphudDelegate?
Is it possible to determine deferred purchase in Apphud.purchase() method?
Hi.
In my ios app there are authorization screens using mail and password. There are 2 states of the application: the user is logged in and not.
Let me know how to correctly identify the user if the authorization system is used in the application, I'm confused :)
if I purchase a non-renewable subscription in testflight environment and then install the AppStore version without uninstalling the testflight version let active = Apphud.isNonRenewingPurchaseActive(productIdentifier: "productID")
always return true
We are getting such crashes after updating from 3.2.3 to 3.2.8
Crashed: com.apple.main-thread
0 ArtWorkout 0x3c496c closure #1 in ApphudInternal.setUserProperty(key:value:setOnce:increment:) + 311 (ApphudInternal+UserUpdate.swift:311)
1 ArtWorkout 0x3c48b0 closure #1 in ApphudInternal.setUserProperty(key:value:setOnce:increment:) + 192 (ApphudUserProperty.swift:192)
2 ArtWorkout 0x3cdb60 closure #1 in ApphudInternal.performWhenUserRegistered(callback:) + 499 (ApphudInternal.swift:499)
3 libswift_Concurrency.dylib 0x4d764 swift::runJobInEstablishedExecutorContext(swift::Job*) + 436
4 libswift_Concurrency.dylib 0x4e9c8 swift_job_runImpl(swift::Job*, swift::ExecutorRef) + 72
5 libdispatch.dylib 0x124b4 _dispatch_main_queue_drain + 748
6 libdispatch.dylib 0x121b8 _dispatch_main_queue_callback_4CF + 44
7 CoreFoundation 0x3751c __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 16
8 CoreFoundation 0x34218 __CFRunLoopRun + 1996
9 CoreFoundation 0x33968 CFRunLoopRunSpecific + 608
10 GraphicsServices 0x34e0 GSEventRunModal + 164
11 UIKitCore 0x22aedc -[UIApplication _run] + 888
12 UIKitCore 0x22a518 UIApplicationMain + 340
13 UIKitCore 0x463734 __swift_destroy_boxed_opaque_existential_1Tm + 12004
14 ArtWorkout 0x1472c main + 120 (AppDelegate.swift:120)
15 ??? 0x1abadad84 (Missing)
These are happening 10 times more:
Crashed: com.apple.main-thread
0 ArtWorkout 0x3c680c specialized MutableCollection._halfStablePartition(isSuffixElement:) + 472 (<compiler-generated>:472)
1 ArtWorkout 0x3c66fc specialized MutableCollection._halfStablePartition(isSuffixElement:) + 200 (<compiler-generated>:200)
2 ArtWorkout 0x3c48b0 closure #1 in ApphudInternal.setUserProperty(key:value:setOnce:increment:) + 192 (ApphudUserProperty.swift:192)
3 ArtWorkout 0x3cdb60 closure #1 in ApphudInternal.performWhenUserRegistered(callback:) + 499 (ApphudInternal.swift:499)
4 libswift_Concurrency.dylib 0x4d764 swift::runJobInEstablishedExecutorContext(swift::Job*) + 436
5 libswift_Concurrency.dylib 0x4e9c8 swift_job_runImpl(swift::Job*, swift::ExecutorRef) + 72
6 libdispatch.dylib 0x124b4 _dispatch_main_queue_drain + 748
7 libdispatch.dylib 0x121b8 _dispatch_main_queue_callback_4CF + 44
8 CoreFoundation 0x3751c __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 16
9 CoreFoundation 0x34218 __CFRunLoopRun + 1996
10 CoreFoundation 0x33968 CFRunLoopRunSpecific + 608
11 GraphicsServices 0x34e0 GSEventRunModal + 164
12 UIKitCore 0x22aedc -[UIApplication _run] + 888
13 UIKitCore 0x22a518 UIApplicationMain + 340
14 UIKitCore 0x463734 __swift_destroy_boxed_opaque_existential_1Tm + 12004
15 ArtWorkout 0x1472c main + 120 (AppDelegate.swift:120)
16 ??? 0x1ae5dad84 (Missing)
I've checked the diff, and found out that preparePropertiesParams
async method was added and call to it in updateUserProperties
in Task
.
My guess is that SDK is trying to access pendingUserProperties
both from main thread (see setUserProperty
) and background thread (see updateUserProperties
) simultaneously, what leads to a crash.
Possible fix would be just to limit pendingUserProperties
to MainActor
, as well as preparePropertiesParams
or use an NSLock
on pendingUserProperties
I purchased the subscription on the real iOS device in sandbox mode, and it showed up in the Manage Transaction Window. But when I try to get subscriptions in the Widget (widget extension, SwiftUI, WidgetKit) and use the "Apphud.subscriptions()" method, I don't get any subscriptions. But when I use the same "Apphud.subscriptions()" method in the iOS app target, this method works and gets subscriptions.
iOS v17.2
Xcode Version 15.1 (15C65)
ApphudSDK v3.2.5
Frameworks: SwiftUI, WidgetKit
newest 2.8.8 code
internal func submitReceipt(product: SKProduct?, apphudProduct: ApphudProduct?, transaction: SKPaymentTransaction?, receiptString: String?, notifyDelegate: Bool, eligibilityCheck: Bool = false, callback: ApphudErrorCallback?) {
self.submitReceipt(product: product,
apphudProduct: apphudProduct,
transactionIdentifier: transaction?.transactionIdentifier,
transactionProductIdentifier: transaction?.payment.productIdentifier,
transactionState: transaction?.transactionState,
receiptString: receiptString,
notifyDelegate: eligibilityCheck,
callback: callback)
}
notifyDelegate: eligibilityCheck,
notifyDelegate: notifyDelegate,
eligibilityCheck: eligibilityCheck
I call Apphud.disableIDFACollection()
before Apphud.start(apiKey: "")
, but when I submit app to app store connect, app store connect still says that my app contains IDFA, is there any way to solve this ?
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.