Skip to content

Commit 0e68a05

Browse files
committed
feat(swift): saveObjectsMCM
1 parent d5179f5 commit 0e68a05

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import Foundation
2+
#if os(Linux) // For linux interop
3+
import FoundationNetworking
4+
#endif
5+
6+
import Core
7+
{{> snippets/import}}
8+
9+
func saveObjectsMCM() async throws {
10+
// Fetch from your own data storage and with your own code
11+
// the list of application IDs and API keys to target each cluster
12+
let configurations = getAllAppIDConfigurations();
13+
14+
// Send the records to each cluster
15+
for (appID, apiKey) in configurations {
16+
do {
17+
let client = try SearchClient(appID: appID, apiKey: apiKey)
18+
19+
{{#dynamicSnippet}}saveObjectsPlaylists{{/dynamicSnippet}}
20+
} catch {
21+
print(error)
22+
}
23+
}
24+
25+
}

0 commit comments

Comments
 (0)