Giter VIP home page Giter VIP logo

icecream's Introduction

IceCream

CI Status Version Carthage compatible License Platform

contributions welcome

IceCream helps you sync Realm Database with CloudKit.

It works like magic!

Features

  • Realm Database

    • Off-line First
    • Thread Safety
    • Reactive Programming
    • Optimized for mobile apps
    • Easy when migrating
  • Apple CloudKit

    • Automatical Authentication
    • Silent Push
    • Free with limits(Private database consumes your user's iCloud quota)
  • Delta update

  • Reachability(Support Long-lived Operation)

  • Powerful Error Handling

  • Sync Automatically

  • Multiple object models support

  • Public/Private Database support

  • Large Data Syncing

  • Manually Synchronization is also supported

  • Relationship(To-One/To-Many) support

  • Available on every Apple platform(iOS/macOS/tvOS/watchOS)

  • Support Realm Lists of Natural Types

  • Complete Documentation

Prerequisite

  1. Be sure to have enrolled in Apple Developer Program
  2. Turn on your iCloud in Capabilities and choose CloudKit
  3. Turn on Background Modes and check Background fetch and Remote notification

Usage

Basics

  1. Prepare your Realm Objects (e.g. Dog, Cat...):
class Dog: Object {
    @objc dynamic var id = NSUUID().uuidString
    @objc dynamic var name = ""
    @objc dynamic var age = 0
    @objc dynamic var isDeleted = false

    static let AVATAR_KEY = "avatar"
    @objc dynamic var avatar: CreamAsset?

    @objc dynamic var owner: Person? // to-one relationships must be optional

    override class func primaryKey() -> String? {
        return "id"
    }
}
  1. Do stuff like this:
extension Dog: CKRecordConvertible & CKRecordRecoverable {
    // Leave it blank is all
}

Is that easy? Protocol Extensions do this trick.

  1. Start the Engine!
var syncEngine: SyncEngine?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
    ...
    syncEngine = SyncEngine(objects: [
            SyncObject(type: Dog.self),
            SyncObject(type: Cat.self),
            SyncObject(type: Person.self)
        ])
    application.registerForRemoteNotifications()
    ...
}
  1. Listen for remote notifications

The sample code in AppDelegate will be a good reference.

That's all you need to do! Every time you write to Realm, the SyncEngine will get notified and handle sync stuff!

For more details, clone the project to see the source code.

Object Deletions

Yep, we highly recommend you use Soft Deletions. That's why we add an isDeleted property to CKRecordConvertible protocol.

When you want to delete an object, you just need to set its isDeleted property to true and the rest of the things are already taken care of.

You also don't need to worry about cleaning-up things. It has also been considered.

How about syncing asset?

Luckily, we have a perfect solution for syncing asset. Absolutely, you could also store your image or kind of resource stuff as Data type and everything works fine. But Realm has a 16MB limit of data property. And CloudKit encourages us to use CKAsset in places where the data you want to assign to a field is more than a few kilobytes in size. So taking the consideration of the above two, we recommend you to use CreamAsset property to hold data. CreamAsset will store local data on the file system and just save file paths in the Realm, all automatically. And we'll wrap things up to upload to CloudKit as CKAsset.

An example project is provided to see the detailed usage.

Relationships

IceCream has officially supported Realm relationship(both one-to-one and one-to-many) since version 2.0.

Especially, for the support of to-many relationship, you have to pass the element type of the List to the SyncObject init method parameters. For example:

syncEngine = SyncEngine(objects: [
            SyncObject(type: Dog.self),
            SyncObject(type: Cat.self),
            SyncObject(type: Person.self, uListElementType: Cat.self) // if Person model has a List<Cat> property
        ])

Requirements

  • iOS 10.0+ / macOS 10.12+ / tvOS 10.0+ / watchOS 3.0+
  • Swift 5

Debug Suggestions

It's true that debugging CloudKit is hard and tedious. But I have some tips for you guys when facing puzzles:

  • You should know how Realm and CloudKit works.
  • Using GUI tools, like Realm Browser and CloudKit Dashboard.
  • When you are lost and don't remember where you are, I suggest starting all over again. In CloudKit Dashboard, "Reset..." button is provided. You can also clear local database by re-install apps.
  • By default, IceCream only prints some logs to your console in DEBUG mode. However, you could turn it off by adding IceCream.shared.enableLogging = false if it bothers you.
  • Keep calm and carry on!

Warning: If you're going to launch your app onto App Store, don't forget to deploy your environment settings to production. You can do it easily in the CloudKit Dashboard. Write & Read permissions are also need to be considered.

One More Tip

How to debug CloudKit in production mode? See this post.

Example

To run the example project, clone the repo, then open the Example/IceCream_Example.xcodeproj.

Installation Guide

Using Swift Package Manager, Carthage or CocoaPods.

Swift Package Manager

From Xcode 11, you can use Swift Package Manager to add IceCream and its dependencies to your project.

Select File > Swift Packages > Add Package Dependency. Enter https://github.com/caiyue1993/IceCream.git in the "Choose Package Repository" dialog. In the next page, specify the version resolving rule as "Up to Next Major" with "2.0.2" as its earliest version. After Xcode checking out the source and resolving the version, you can choose the "IceCream" library and add it to your app target.

If you encounter any problem or have a question on adding the package to an Xcode project, I suggest reading the Adding Package Dependencies to Your App guide article from Apple.

Carthage

Carthage is a decentralized dependency manager for Cocoa applications.

To integrate IceCream into your Xcode project using Carthage, specify it in your Cartfile:

github "caiyue1993/IceCream"

Then, run the following command to build the frameworks:

carthage update

Normally, you'll get IceCream, Realm and RealmSwift frameworks. You need to set up your Xcode project manually to add these 3 frameworks.

On your application targets’ General settings tab, in the Linked Frameworks and Libraries section, drag and drop each framework to use from the Carthage/Build folder on disk.

On your application targets’ Build Phases settings tab, click the “+” icon and choose “New Run Script Phase”. Create a Run Script with the following content:

/usr/local/bin/carthage copy-frameworks

and add the paths to the frameworks you want to use under “Input Files”(taking iOS platform for example):

$(SRCROOT)/Carthage/Build/iOS/IceCream.framework
$(SRCROOT)/Carthage/Build/iOS/Realm.framework
$(SRCROOT)/Carthage/Build/iOS/RealmSwift.framework

For more information about how to use Carthage, please see its project page.

CocoaPods

IceCream is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'IceCream'

If you want to build IceCream as a static framework, CocoaPods 1.4.0+ is required.

Make it better

This is the to-do list for the IceCream project. You can join us to become a contributor.

  • CloudKit Shared Database

See the CONTRIBUTING file for contributing guidelines.

Live Demo

My app Music Mate (The missing mate for Apple Music) is using IceCream to its fullest. You can download it and try it on your multiple devices to see this magic.

Reference

Contributors

This project exists thanks to all the people who contribute:

Sponsorship

Open source is great, but it takes time and efforts to maintain. I'd be greatly appreciated and motivated if you could to support the maintenance of IceCream financially. You could sponsor this project through the below ways:

And thanks to all our backers on open collective:

License

IceCream is available under the MIT license. See the LICENSE file for more info.

icecream's People

Contributors

aplusm avatar binlogo avatar bitomule avatar bobspryn avatar bofrese avatar caiyue1993 avatar davidrothera avatar dbmrq avatar fouquet avatar ingmarstein avatar jnchman avatar jonyfang avatar julianschiavo avatar kitlangton avatar linuxsuren avatar meteochu avatar monkeywithacupcake avatar mrfufufu avatar randycarney avatar raullermen avatar revolter avatar roczhang9673 avatar ss18 avatar tiagomartinho avatar tzechuen avatar yulian948 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

icecream's Issues

No IceCream debug print statements

Since updating to latest IceCream (from 1.6.x to 1.7.x) I am no longer seeing debug statements. I tried running the Example app inside the repo and also don't see IceCream debug printouts. I am using Carthage and did not modify the source. Were these removed?

Expected behavior

IceCream outputs debug log statements to the console

Actual behavior(optional)

No debug statements are printed

Two way Sync

Does this library handle two-way sync? Let's say we have one record per day (tracking user steps taken every day), user's data is synced for 10 days, the user deletes the app and installs again, the previous 10 days data will be available locally after the sync?

Custom Local Realm

Expected behavior

I can define which realm should be synced.

Actual behavior(optional)

Right now, the default realm is used, sometimes with Cream, sometimes not. (as far as I saw)

Steps to reproduce the problem(optional)

I noted it because of migration issues. So as described in Realm Documentation you can change the Realm-config for local migrations.

I would love to give the realm I set up as a parameter to the SyncEngine.
I can provide a small fix if you want.

Compilation erros due to private methods

Expected behavior

Compile without errors

Actual behavior(optional)

tried to pod reintegrate, and clean derived data and Xcode project

compiles with errors indicating that methods
syncObjects
errorHandler
privateDatabase
fetchChangesInDatabase
notificationToken
are inaccessible due to private protection level in file SyncEngine

zrzut ekranu 2018-08-23 08 43 18

Steps to reproduce the problem(optional)

Add IceCream 1.5.0 to Podfile, pod install, compile project.
OR
git clone library GitHub repo, pod install in Example folder, compile project

Other info

pod try works without any problems.

404 on contribution link

Below is the issue template. You can fill each part then submit your issue.
Or you can just delete all of these and describe your questions in you-like style.
But please remember: the more detailed info you offered, the greater possibility your problem will be solved. 😜

Expected behavior

// Please replace this line with your expected behavior.

Actual behavior(optional)

// Please replace this line with the actual behavior.

Steps to reproduce the problem(optional)

// Please provided to steps to reproduce the problem

Reference links(optional)

// Please offer the reference links to us. We appreciate it.

issue with CocoaPods !!

Hi ,

I can't install IceCreeam using CocoaPods

I got this message :

[!] CocoaPods could not find compatible versions for pod "IceCream":
  In Podfile:
    IceCream (~> 1.3.0)

Specs satisfying the `IceCream (~> 1.3.0)` dependency were found, but they required a higher minimum deployment target.

Workaround for using references?

Hi,

I was looking for a way to sync my Realm database with CloudKit, and IceCream seems to be the best solution for it. However, I'm using references in my Realm database and IceCream doesn't seem to support those yet. Would it be a viable workaround to save the ID of an object instead of the object reference?

Thank you,
Stefan

Nested frameworks and submission failure

When preparing an app that depends on IceCream (via Carthage) for the Store/Testflight the following errors are given: ...contains disallowed nested bundles and ...contains disallowed file 'Frameworks'.

The project itself depends on realm-cocoa as well, so in addition, I get CFBundleIdentifier Collision. There is more than one bundle with the CFBundleIdentifier value… for Realm and RealmSwift.

It is my understanding this is due to the copy framework script. While this seems to work during runtime (and on my device), it causes submission problems. So the copy framework phase should probably be removed and only happen at the app level.

Similar discussions I found regarding this issue:

CKAsset support

Does IceCream support CKAsset. I'm using CloudKit, and there are some images needs to save in iCloud. I didn't find some code about CKAsset.

Will you support it in the future if you haven't support it yet?

Carthage support

It would be great to be able to install this via Carthage as well as CocoaPods!

Build failed when installing using carthage update

I have a cartfile with contents as github "caiyue1993/IceCream".

The carthage log file contains the error:

error: no such file or directory: '/Users/xxxxx/Carthage/Checkouts/IceCream/IceCream/Classes/SyncSource.swift'

On running carthage update..here is the full terminal output:

*** Cloning IceCream
*** Cloning realm-cocoa
*** Checking out IceCream at "1.4.0"
*** Downloading realm-cocoa.framework binary at "v3.5.0"
*** Skipped installing realm-cocoa.framework binary due to the error:
"Incompatible Swift version - framework was built with 4.1 (swiftlang-902.0.48 clang-902.0.37.1) and the local version is 4.0 (swiftlang-900.0.65 clang-900.0.37)."
*** Checking out realm-cocoa at "v3.5.0"
*** xcodebuild output can be found in /var/folders/7f/y0vvrb7563n6m_2_g8ck9_3r0000gp/T/carthage-xcodebuild.kAk0wC.log
*** Building scheme "RealmSwift" in Realm.xcworkspace
*** Building scheme "Realm" in Realm.xcworkspace
*** Building scheme "IceCream" in IceCream.xcodeproj
Build Failed
Task failed with exit code 65:
/usr/bin/xcrun xcodebuild -project /Users/muhammadimran/Documents/Work/Apple/CODE/IslamAndQuranPro_code_bk/Carthage/Checkouts/IceCream/IceCream.xcodeproj -scheme IceCream -configuration Release -derivedDataPath /Users/muhammadimran/Library/Caches/org.carthage.CarthageKit/DerivedData/9.0_9A235/IceCream/1.4.0 -sdk iphoneos ONLY_ACTIVE_ARCH=NO BITCODE_GENERATION_MODE=bitcode CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES archive -archivePath ./ GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=NO CLANG_ENABLE_CODE_COVERAGE=NO (launched in /Users/muhammadimran/Documents/Work/Apple/CODE/IslamAndQuranPro_code_bk/Carthage/Checkouts/IceCream)

This usually indicates that project itself failed to compile. Please check the xcodebuild log for more details: /var/folders/7f/y0vvrb7563n6m_2_g8ck9_3r0000gp/T/carthage-xcodebuild.kAk0wC.log

Split CloudKit requests into smaller chunks

IceCream does not split CloudKit requests into smaller chunks in syncObjectsToCloudKit. This can lead errors such as the following:

Error: Your request contains 492 items which is more than the maximum number of items in a single request (400)

Realm collection notifications can easily contain many items (e.g. due to realm/realm-swift#3494 or during a bulk import). Most of the times, it can be worked around on the application level, but I think the library should handle this case gracefully.

Expected behavior

All modified objects are updated in CloudKit.

Actual behavior(optional)

The CloudKit request fails with the error above.

Reference syncing problem

Expected behavior

I create the object with specific properties (in my app example Habit with habit infos) and additional objects referencing to this object (one-to-many) - statuses for specific dates related to habit. Initial sync seems to be working well, because data gets stored and is visible on iCloud dashboard.

Actual behavior(optional)

Up to this point, data is synced but if I remove the application and install in on device again, some of the items are missing, even tho they are stored in iCloud. Same goes if I install the app on other device.

Steps to reproduce the problem(optional)

  1. First I create the habit and change status to success on certain dates (simulator):
    1

  2. I install the app on my real device, open the calendar and statuses on speicfic dates are missing (18):
    img_de5c098a367c-1
    As you can see on my dashboard, there are 7 records and 18th day is there as well..
    image

  3. Even futher, if I add more statuses and reinstall the app then even more of them are missing.
    Example with more statuses going away:
    img_c5073ab15ce8-1
    2

Seems like I am having some problems with syncing. @caiyue1993, any idea? If you need more information about code, let me know.

Prints with Carthage

Expected behavior

See IceCream debug logs.

Actual behavior(optional)

No logs.

Steps to reproduce the problem(optional)

Use IceCream with Carthage.

Is this expected? I don't see any debug info and don't know if I'm doing something wrong or just the expected behavior.

Does IceCream use the incremental update?

I know the CoreData supported the incremental update, and realm file do not support it. Does the IceCream automatically detect the change of the realm database and upload the file to the iCloud?

Encrypted realm leads to crash

EDIT: I traced it to the Cream.swift file's init. This occurs when the Realm is Encrypted.

I recently incorporated IceCream into my project, and after code setup through looking at Example Project and the Docs, Xcode crashes (and the app) when syncEngine = SyncEngine<MyRealmClassHere>() is called in AppDelegate. This only occurs when AppleID is signed in.

Details: Swift 4, Xcode 9.1 (9B55), iPhone 6 Simulator

Expected behavior

Code execution goes as normal, no crash. SyncEngine runs.

Actual behavior(optional)

Run project, Xcode crashes upon app start up. I have tracked it down to SyncEngine crashes Xcode and app only when AppleID is logged in, regardless of whether it can connect to any data or not (EX: wifi off).

Steps to reproduce the problem(optional)

  1. Set up according to documentation, also looking at example project.
  2. Run SyncEngine after Realm Migration. I tried it before migration, same error.

Zone not found, first sync fail

Hey guys, this library is awesome thank you for creating it.
I've noticed that when launching the SyncEngine the first time it syncs, I get the following errors:
"ErrorHandler.Fail: Zone Not Found: the specified record zone does not exist on the server.CKError.Code: 26".

I checked the code and I noticed that in the init, the createCustomZones function is called after syncRecordsToCloudKit, so I believe this is why I get the errors.

The flow I use in the app is the following:
iCloud is disabled by default, the user can add objects to realm and use the app.
In Settings I've a toggle to turn iCloud on, when that happens the SyncEngine gets initialized.

At the moment as a workaround I just call syncRecordsToCloudKit after the init and that solves the problem.

Thank you.

Error with multiple objects

Expected behavior

I´ve multiple Realm objects and I expected them all to sync with Cloudkit but only some do. I just call and store reference of multiple SyncEngine references. Is that supported?

Actual behavior(optional)

Only some syncEngines seem to work.

Swift 4.2 support?

Expected behavior

IceCream works with the latest version of Swift!

Actual behavior

IceCream works with Swift 4.0, but not Swift 4.2. These errors occur:

screen shot 2018-09-19 at 10 18 26 pm

Steps to reproduce the problem

Create a new project with Xcode 10 or later, add IceCream as a dependency using CocoaPods, then build.

Note

I can have a PR ready, if desired!

'Invalid value '1' of type 'NSTaggedPointerString' for 'int'

Hi, I'm caught a crash with error message:

*** Terminating app due to uncaught exception 'RLMException', reason: 'Invalid value '1' of type 'NSTaggedPointerString' for 'int' property 'DictionaryObj.id'.'

I have this issue because my id in all objects is Int type, I guess.

import RealmSwift
import IceCream

final class DictionaryObj: Object {
    @objc dynamic var id = 0
    @objc dynamic var name = ""
    @objc dynamic var isIncome = false
 
    override class func primaryKey() -> String? {
        return "id"
    }
    
    //Incrementa ID
    static func incrementId() -> Int {
        let realm = try! Realm(configuration: CONFIG_REALM)
        if let lastObj = realm.objects(DictionaryObj.self).sorted(byKeyPath: "id").last {
            return lastObj.id + 1
        } else {
            return 1
        }
    }
}

extension DictionaryObj: CKRecordConvertible {
    var isDeleted: Bool {
        return false
    }
    
    // Yep, leave it blank!
}

extension DictionaryObj: CKRecordRecoverable {
    // Leave it blank, too.
}

Less verbose logging/printing in console

Currently, IceCream is printing a lot of information to the console. Most of the time, I don't need as much information (like every database item). The many logs sometimes even get in the way of development, as I have trouble finding my own debug log outputs.

I would love it if logging could be optional. This could be achieved either through delegation, where the delegate functions receives information about the sync status or errors, which I can then print if I want to. The other way (I think) would be through completion handlers / closure blocks that provide information, that I can also decide on whether to print or not.

Is this something useful or needed, or is there some other way to turn off logs from a framework?

How to remove CreamAsset from Realm file ?

I had deleted IceCream
from my project

and I'm sure the pre-bundle Realm file doesn't have CreamAsset

but after I run the app

I found there is CreamAsset in my realm file

how that is possible ?

and how can I delete it ?

Why create custom zone?

Document

However, the CKRecord.Reference class does not support cross-zone linking, so each reference object must point to a record in the same zone as the current record.

public static var customZoneID: CKRecordZone.ID {
    return CKRecordZone.ID(zoneName: "\(recordType)sZone", ownerName: CKCurrentUserDefaultName)
}

IceCream create custom zone every object class, but reference can't link.

So, why not use default zone?

Support Realm's Link format

Expected behavior

IceCream should sync Realm's Link format to CloudKit's Arrays.

Actual behavior(optional)

IceCream completely ignores Realm's Links.

Could IceCream be updated to support Links? (only with the types of Arrays CloudKit supports are needed).

Hangs when there are too many changes

My app gives the user the option to delete all his data and also to restore data from backup files.

When erasing all data, I used realm.deleteAll(). Now that I'm using IceCream, I iterate over all my objects and set isDeleted to true.

Then, when restoring data, I go over a different Realm database and use realm.create() to add it to the current Realm.

Now, using IceCream, if I open my app in two devices at the same time, erase all data and then add it back from a backup file, the app will receive the cloudKitDataDidChangeRemotely hundreds of times and it'll hang forever, making it unusable and requiring me to force quit.

In these cases I think it would be better to group multiple changes together and sync them on a background thread.

README.md : Add Entry for remote notifications setup

In the Usage part of the README.md, a section should be added regarding remote notifications.

Otherwise, by default, no remote notifications will be synchronised by the SyncEngine.

The code presents in the Example could be a good start :

func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) {
       
       let dict = userInfo as! [String: NSObject]
       let notification = CKNotification(fromRemoteNotificationDictionary: dict)
       
       if (notification.subscriptionID == IceCreamConstant.cloudKitSubscriptionID) {
            NotificationCenter.default.post(name: Notifications.cloudKitDataDidChangeRemotely.name, object: nil, userInfo: userInfo)
       }
       completionHandler(.newData)
       
   }

Does IceCream support CKReference & Realm's LinkingObjects?

Thank you for your great work!

I'm try to extension my already exists realm object with IceCream's CKRecordConvertible & CKRecordRecoverable, And may I wonder does IceCream support CKReference & Realm's LinkingObjects?

For example:

I have a realm object like this:

class HistoryRecord: Object {
@objc dynamic var ckRecordID = NSUUID().uuidString
@objc dynamic var isDeleted = false
@objc dynamic var updateTime: TimeInterval = Date().timeIntervalSince1970
@objc dynamic var linkedDigest: LocalDigest?
}

I used to save the "LinkedDigest" as a CKReference in CloudKit.
And how about the Realm's LinkingObjects?

Backup issue

Hi, I have one question. If I delete app, my all data deleting on iCloud too? Can I save this data on iCloud and when app reinstalling all data loading again?

Add pre/post hooks for model object updates

Example: I index my model objects into CoreSpotlight for searching. It would be great if SyncEngine had a postUpdate block in which I could do additional work on the updated model. Maybe like

class SyncEngine {
…
var postUpdate: ((added: [T], deleted: [T], updated: [T]) -> ()) = { _, _, _ in }
…

and then invoke it in fetchChangesInZone after all the changesOp blocks complete. Or if it would make it easier, one block per each: postAdd, postUpdate, postDelete.

I'm happy to do this in a pull request if it seems like a good direction.

Option for syncing

Hey!

First of all, thank you for such a great option to have! Yesterday I was playing with Realm + Realm Platform but then I found out about IceCream and it works like charm.

My question is, could it be possible for user to select either he wants to sync to iCloud or just store locally?
My app is storing record data and I am not sure how Apple is with the way that IceCream automatically syncs to signed Apple account? I would love to have an option i.e. on onboarding part for user to select if he wants to enable sync or not. Is that possible? How are you dealing with this?

Edit: Additional question. If I install app on my device, it works like charm. If I put it on Testflight, friend doesn't get data synced back after reinstall. Is it because I am using Development container and I should deploy to Production?

Thanks,
Zan

Support iOS 10.0

Expected behavior

Support minimum deployment target iOS 10.0

Actual behavior(optional)

The minimum deployment target is iOS 11.2 right now

CreamAsset uniqueFileName

Hi,

What's the purpose of appending an UUID to the uniqueFileName property ?

self.uniqueFileName = "\(uniqueKey)_\(UUID().uuidString)"

The use-case i'm facing is the update of an image asset for the same object (i.e same unique key).

From the API, i suppose the proper way of updating an asset is by recreating a CreamAsset object. In this case, the uniqueFileName property will be a new unique one, and the 2 images will be stored on the userDevice.

Am i missing something ?

Sync old changes, not only updates

Expected behavior

Sync existing realm data to CloudKit.

Actual behavior(optional)

Objects present in the database before adding Icecream doesn´t sync.

Steps to reproduce the problem(optional)

Create a realm database without Icecream, add and setup Icrecream to your project. Only updates are pushed to the cloud.

Add sharing support

CloudKit now has the sharing feature. It would be cool if we could have a way to sync records using the shared database as well (and maybe an easy way to create shares using IceCream)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.