11 Replies
      Latest reply on Mar 5, 2019 11:55 AM by KMT
      Marc Hervera Level 1 Level 1 (0 points)

        Hello,

         

        I'm creating a set of applications with transparent login based on the UserRecordID of CloudKit. Everything was working perfectly until I realized that you can't upload iOS and macOS applications with the same Bundle ID.

         

        The problem is that the UserRecordID is not the same if you change the Bundle ID.

        Is there any way to make it the same for all apps (iOS, tvOS, macOS) or upload iOS and macOS app with same Bundle ID?

         

        Thanks!

        • Re: UserRecordID between iOS and macOS apps
          PBK Level 7 Level 7 (3,045 points)

          Is the problem the userRecordID being different or that you are accessing completely different default databases  from two different apps?  You need to direct the apps to use a shared space not their defaults. You do that on the Capabilities page.

            • Re: UserRecordID between iOS and macOS apps
              Marc Hervera Level 1 Level 1 (0 points)

              No, the problem is that the userRecordID is different.

              I want to make a unique-transparent login for the user using the userRecordID. All works without a problem in dev, but I tried to create a same bundle ID for iOS and macOS apps but I can't. If I chage the bundle ID, userRecordID changes...

                • Re: UserRecordID between iOS and macOS apps
                  PBK Level 7 Level 7 (3,045 points)

                  I admire your certainty.  If it is accurate then why don't you insert a field into that userRecord and store an app-generated UUID in that field?  Use that app-generated UUID as your unique-transparent ID. 

                   

                  But....if your belief that the two records are the same is actually incorrect, that by changing the Bundle ID you are accessing a different area of CloudKit, then go back and read my original answer.

                  • Re: UserRecordID between iOS and macOS apps
                    KMT Level 9 Level 9 (13,775 points)

                         >I want to make a unique-transparent login for the user using the userRecordID.

                     

                    You might have more luck generating a token (DIY server managed) based on userRecordID and then apply it across apps instead.

                      • Re: UserRecordID between iOS and macOS apps
                        Marc Hervera Level 1 Level 1 (0 points)

                        But userRecordID is unique and is secure to avoid fake generated IDs from external attack. If the user generates a userRecordID on database, nobody else can generate another credentials (on my server, not CloudKit)

                          • Re: UserRecordID between iOS and macOS apps
                            KMT Level 9 Level 9 (13,775 points)

                            Is that what this is about? Fake logins vs inter-app login portability?

                             

                            Again, don't expect to use uRID directly.

                             

                            But if your concern is mainly about piracy, say so and we'll see if we can work on that, instead.

                              • Re: UserRecordID between iOS and macOS apps
                                Marc Hervera Level 1 Level 1 (0 points)

                                I think I've been respectful all times to get an answer like this.

                                 

                                Having said this, I want to make anonymous login to maintain privacy of my users. The best way that I found is using userRecordID because it depends of the iCloud account, and once registered in my system, I can prevent someone who intercepts the keys from registering again by limiting the possible identifiers (unique userRecordID). The problem I found is that the userRecordID depends on the Bundle ID, and the Bundle ID cannot be the same in iOS and macOS. That's it!

                                 

                                On the other hand, the PBK approach is interesting, generating a unique ID and propagating it through the user's private database can be a god choice.

                                 

                                Thanks both!