Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: JsonUnwrapper on iOS has incorrect key for VendorGrant #57

Merged
merged 2 commits into from
May 24, 2024

Conversation

OmarVector
Copy link
Contributor

Currently on the latest version sourcepoint SDK for unity . On iOS, it doesnt matter what selection you do inside PrivacyManager, everything return false, all VendorGrant are always false unlike on android.

Did a dive inside the SDK code and json return, I Found the key for vendorGrants on iOS called "vendorGrant", while on Android json its called "granted"

Checking the grants list from IOS:
"grants":{
"liksdhginsehgionwehcgnih":{
"vendorGrant":true,
"purposeGrants":{
"fasoifhashfnahfiohioh":true
}
},
"35252352352352352":{
"vendorGrant":true,
"purposeGrants":{
"325235235235235235":true
}
},
"32525236236423":{
"vendorGrant":true,
"purposeGrants":{
"gdsgdsgsdg45346":true
}
},
"gdwertgerty436346346":{
"vendorGrant":false,
"purposeGrants":{
"dgergewr436436346346":false
}
}
}

You can see the key is called vendorGrant, unlike on Android which is called "granted"

"grants":{
"43634634dfgdfg":{
"granted":true,
"purposeGrants":{
"43634634gdfsgdfg":true
}
},
"43634643gsdgdfsg":{
"granted":true,
"purposeGrants":{
"3463463464sdgedgerg":true
}
},
"346346346346":{
"granted":true,
"purposeGrants":{
"dfgegwergrwegwre43":true
}
},
"42643634634634yt":{
"granted":true,
"purposeGrants":{
"gssgerwtwt4t3t":true
}
}
}

So I added the fix, however, I'm not sure if the json suppose to look different like this or not.

If this not the ideal fix, currently would be great if you could consider a fix for this issue in the upcoming release:)

Thanks for your patience.

the json return from android is different than the one on IOS

Checking the grants list:
"grants":{
            "liksdhginsehgionwehcgnih":{
               "vendorGrant":true,
               "purposeGrants":{
                  "fasoifhashfnahfiohioh":true
               }
            },
            "35252352352352352":{
               "vendorGrant":true,
               "purposeGrants":{
                  "325235235235235235":true
               }
            },
            "32525236236423":{
               "vendorGrant":true,
               "purposeGrants":{
                  "gdsgdsgsdg45346":true
               }
            },
            "gdwertgerty436346346":{
               "vendorGrant":false,
               "purposeGrants":{
                  "dgergewr436436346346":false
               }
            }
         },



You can see the key is called vendorGrant, unlike on Android which is called granted

"grants":{
         "43634634dfgdfg":{
            "granted":true,
            "purposeGrants":{
               "43634634gdfsgdfg":true
            }
         },
         "43634643gsdgdfsg":{
            "granted":true,
            "purposeGrants":{
               "3463463464sdgedgerg":true
            }
         },
         "346346346346":{
            "granted":true,
            "purposeGrants":{
               "dfgegwergrwegwre43":true
            }
         },
         "42643634634634yt":{
            "granted":true,
            "purposeGrants":{
               "gssgerwtwt4t3t":true
            }
         }
      },
@andresilveirah
Copy link
Member

Hi @OmarVector thank you for submitting this PR! We're reviewing it and will get back to you soon.

@andresilveirah andresilveirah requested a review from Nevazhnovu May 24, 2024 10:39
if (vendorGrantValue["granted"] != null)
isGranted = vendorGrantValue["granted"].ToObject<bool>();
if (vendorGrantValue["vendorGrant"] != null)
isGranted = vendorGrantValue["vendorGrant"].ToObject<bool>();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@OmarVector let me check if it interferes with Android implementation.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@OmarVector let me check if it interferes with Android implementation.

From my tests, its not, also, Android has custom Unwrapper function called UnwrapSpGdprConsentAndroid();

I'm not sure about another platform like PC/Mac if its supported. good luck💪

And thanks for your patiences:)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@OmarVector I confirm, that's true. Including this PR to the closest release.

Copy link
Collaborator

@Nevazhnovu Nevazhnovu May 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@OmarVector you can merge when ready; we're going to include this to release 2.3.2 today anyway. Thank you for the PR!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Nevazhnovu
Thank you:)

I dont have write access to merge it to your branch:)
however I merged with my forked release one:))

Thanks once again for your patience:))

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You welcome! :)

@Nevazhnovu Nevazhnovu mentioned this pull request May 24, 2024
3 tasks
@Nevazhnovu Nevazhnovu merged commit b6a4566 into SourcePointUSA:release-2.3.2 May 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants