Comments (6)
Hi @kbalani12,
The method requestImmediateDataFlush
actually just flushes the local data to the server for the current user. Since you are looking to get the latest content cards, can you try using requestContentCardsRefresh
instead?
from appboy-ios-sdk.
This is exactly what we do, the problem is that it doesn't work for the very first launch. The sequence that we need to enforce is that current user is set first and then content card is refreshed. we can't enforce this because we don't know when local data is flushed to server. If we call refreshContentCards
prior to it then all we get is empty result.
from appboy-ios-sdk.
Hi @kbalani12,
Sorry about the delay! After calling changeUser
, the local data is automatically flushed to the server (regardless of the ProcessingPolicy since this behavior is needed for proper functionality), so no need to call requestImmediateDataFlush
after changing user.
Depending on when you attempt to display the content cards after changing user, you may be displaying it prior to the content card payload coming back. Also, depending on how your campaign is set up and which experiments you are running, you may want to update your campaign settings to set when to re-evaluate eligibility for the content card to get the appropriate cards at display time. To have our team look at your integration + your campaign settings further, please contact [email protected] with the relevant campaigns and our Support team can follow up with the issues you are facing.
Thanks!
from appboy-ios-sdk.
This isn't specific to campaign, most of iOS API that are async (via network or computing delay) needs to be accompanied with a success/failure notification callbacks or delegate.
This is done via WebSDK of Braze.
Their method signature:
requestImmediateDataFlush(callback?: (success: boolean) => void): void
If we refresh content cards using this sequences:
Appboy.sharedInstance().changeUser("user id")
Appboy.sharedInstance().requestContentCardsRefresh()
Content cards returns stale response. However, the below one returns the correct response
Appboy.sharedInstance().changeUser("user id")
DispatchQueue.main.asyncAfter(deadline: .now() + 2.0) {
Appboy.sharedInstance().requestContentCardsRefresh()
}
Ideally what we would like to do instead.
Appboy.sharedInstance().changeUser("user id", completion: { error in
if (!error) {
Appboy.sharedInstance().requestContentCardsRefresh()
}
})
The request for this is to at minimum provide a callback for requestImmediateDataFlush
.
from appboy-ios-sdk.
Hi @kbalani12,
The proposed solution above actually would not address your use case because the endpoints for user data and Content Cards are separated out, meaning that changeUser
/ requestImmediateDataFlush
is communicating with a separate endpoint than what refreshContentCards
is. This means that even if we accepted a completion
to the first couple APIs, we would not be able to guarantee it is executed in the manner you describe.
However, the current default implementation of Content Cards should be adequate to handle your use case, as it will automatically refresh Content Cards in a few places. First, whenever a Content Card feed is about to be displayed, it will request for the latest cards if it is outside of a timeout. Also, if you monitor the requests that come to your device using a tool such as Proxyman, you will notice that immediately after changing a user, there will be another request from the /content_cards
endpoint which contains the new data for that user.
Let me know if that answers your questions!
from appboy-ios-sdk.
I'm closing this issue due to inactivity. Feel free to contact our Support team at [email protected] if you continue to run into issues or have more details related to this thread.
Thanks!
from appboy-ios-sdk.
Related Issues (20)
- [Feature]: Modal In-app message could be dismissed also by tapping on blurred background HOT 2
- Test Issue
- [Bug]: Appboy-iOS-SDK 4.4.3 + not Archiving with Bitrise HOT 3
- [Bug]: Appboy ios SDK 4.4.4 archive failed HOT 4
- [Bug]: Blank UIWindow when IAM received HOT 2
- [Bug]: Geofence not working at all HOT 2
- [Bug]: Previews not working on Xcode 14.X HOT 6
- [Bug]: ABKUIUtils.activeWindowScene sometimes is wrong HOT 3
- [Bug]: Background Task will cause a risk of termination from [ABKService processRequest:] HOT 4
- [Bug]: Appboy 4.5.2 has been crashed when try to use method "logPurchse:" HOT 8
- [Bug]: UI unresponsiveness if invoked on the main thread HOT 3
- [Feature]: methods for handling `brazeAction` uri's HOT 1
- [Bug]: Push notification received after `Appboy.disableSDK` HOT 4
- [Feature]: HOT 2
- [Bug]: SDWebImage dependency. HOT 1
- [Bug]: ABKCustomPropertyUtils validateArray HOT 6
- [Bug]: From 4.2.0 to 4.5.4, deviceToken registration fails. No push dialog box is displayed HOT 9
- [Feature]: Upgrade SDWebImage to latest HOT 6
- [Bug]: 0x1b4ea62b8 __CFBinaryPlistWriteOrPresize + 556 HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from appboy-ios-sdk.