I am attempting to do Google Calendar synchronization with iOS and Android.
For iOS i am utilizing google-api-objectivec-client-for-rest
For Android i am utilizing the strategy with contentResolver and ContentValues
calendar-provider
I perceive that on iOS facet is utilizing the Relaxation API and on the opposite facet on Android is utilizing the content material supplier.
So as to not duplicate the occasions i’ve used the ID from android that may be a lengthy worth. When i had applied on iOS, i came upon that the ID is a String (very lengthy and never integer).
On iOS i came upon:
**
* Opaque identifier of the occasion. When creating new single or recurring
* occasions, you possibly can specify their IDs. Supplied IDs should comply with these guidelines:
* - characters allowed within the ID are these utilized in base32hex encoding, i.e.
* lowercase letters a-v and digits 0-9, see part 3.1.2 in RFC2938
* - the size of the ID should be between 5 and 1024 characters
* - the ID should be distinctive per calendar As a result of globally distributed nature
* of the system, we can't assure that ID collisions can be detected at
* occasion creation time. To reduce the danger of collisions we advocate utilizing
* a longtime UUID algorithm resembling one described in RFC4122.
* If you don't specify an ID, will probably be robotically generated by the
* server.
* Observe that the icalUID and the id aren't similar and solely considered one of them
* needs to be provided at occasion creation time. One distinction of their semantics
* is that in recurring occasions, all occurrences of 1 occasion have totally different ids
* whereas all of them share the identical icalUIDs.
*
* identifier property maps to 'id' in JSON (to keep away from Goal C's 'id').
*
@property(nonatomic, copy, nullable) NSString *identifier;
So it seems that the ID from relaxation is an Opaque iD, however the ID from Android is definitely a sequence generated by Google after the occasion creation.
I’ve tried to seek for the Opaque ID from Android facet however i am not capable of finding it into the docs. And that is most likely achieved on objective as a result of the ContentUris.withAppendedId(CalendarContract.Occasions.CONTENT_URI, googleID)
truly takes an extended as ID.
I’ve discovered the same reply right here and i’ve adopted it setting a customized UID on Android facet for the parameter CalendarContract.Occasions.UID_2445. (as is just not generated robotically even when i attempt to do a question after the insertion)
UUID.randomUUID().toString()
.exchange("-", "")
.lowercase()
However when i attempt to get the identical occasion from iOS i am not capable of do it as a result of i am getting error not discovered.
I’ve tried to get all of the occasions and columns to see if i can get it by doing a question however truly it is not a area.
For instance on android facet i’ve set uID = 62b92a9f626c4a7da7653f7f5c758d04
however on iOS i am getting this:
This distinction between the api was achieved on objective?
Ought to i take advantage of relaxation api on android to get the identical factor? I did not discover any out of the field.
How am i able to synchronize the occasions between Android and iOS if the occasions id’s generated are totally different?