예제 #1
0
        public async void LoadNewPostsWithRecordID(CKRecordID recordID)
        {
            // Called when AppDelegate receives a push notification
            // The post that triggered the push may not be indexed yet, so a fetch on predicate might not see it.
            // We can still fetch by recordID though
            CKDatabase publicDB = CKContainer.DefaultContainer.PublicCloudDatabase;

            try {
                CKRecord record = await publicDB.FetchRecordAsync(recordID);

                Post postThatFiredPush = new Post(record);
                postThatFiredPush.LoadImage(null, TableView.ReloadData);
                postManager.LoadNewPosts(postThatFiredPush);
            } catch (NSErrorException ex) {
                Console.WriteLine(ex.Error);
            }
        }
예제 #2
0
        public async Task <CKRecord> FetchRecordAsync(string id)
        {
            var current = new CKRecordID(id);

            return(await publicDatabase.FetchRecordAsync(current));
        }