Note: This release is in preview. Features described here don’t become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.
Briefcase Priming Records Response
Handles responses for all Mobile SDK Briefcase Priming requests.
In addition to the request factory method, Mobile SDK provides a custom Briefcase response object. Use the properties of this object to obtain parsed Briefcase response values.
Properties
- Priming records (map or dictionary; contains record IDs and their modification timestamps)
- Relay token (string; if null, no more records are available)
- Rule errors (string array; contains IDs of priming rules that were processed but resulted in an error)
- Stats (object containing number of rules, number of records, number of rules served, and number of records served)
iOS
- Swift
- Response handling:
1let parsedResponse = 2 PrimingRecordsResponse(try response.asJson() as! [AnyHashable : Any]) 3let records = parsedResponse.primingRecords 4let token = parsedResponse.relayToken 5let ruleErrors = parsedResponse.ruleErrors 6let stats = parsedResponse.stats - Objective-C
- Response
handling:
1SFSDKPrimingRecordsResponse* parsedResponse = [[SFSDKPrimingRecordsResponse alloc] 2 initWith:response]; 3NSDictionary<NSString*, NSDictionary<NSString*, 4 NSArray<SFSDKPrimingRecord*>*>*>* primingRecords = 5 parsedResponse.primingRecords; 6NSString *relayToken = parsedResponse.relayToken; 7NSArray<SFSDKPrimingRuleError*>* ruleErrors = parsedResponse.ruleErrors; 8SFSDKPrimingStats * stats = parsedResponse.stats;
Android
- Kotlin
- Request factory
method:
1val parsedResponse = PrimingRecordsResponse(result.asJSONArray()) 2val primingRecords = parsedResponse.primingRecords 3val relayToken = parsedResponse.relayToken 4val ruleErrors = parsedResponse.ruleErrors 5val stats = parsedResponse.stats - Java
- Response
handling:
1PrimingRecordsResponse parsedResponse = 2 new PrimingRecordsResponse(result.asJSONObject()); 3String stats = parsedResponse.stats; 4Map<String, Map<String, List<PrimingRecordsResponse.PrimingRecord>>> records = 5 parsedResponse.primingRecords; 6String relayToken = parsedResponse.relayToken; 7List<PrimingRecordsResponse.PrimingRuleError> ruleErrors = parsedResponse.ruleErrors;
See Also
- SFSDKPrimingRecordsResponse.h in the SalesforceMobileSDK-iOS repo.
- PrimingRecordsResponse.java in the SalesforceMobileSDK-Android repo.
- Priming Records request:“Briefcase Priming Records Resource" in Connect REST API Developer Guide
- “Priming Record Collection" in Connect REST API Developer Guide (Priming Records response)