File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed
OneSignalExample/Assets/OneSignal/src Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -1032,6 +1032,31 @@ private void onPostNotificationFailed(string jsonString) {
1032
1032
}
1033
1033
}
1034
1034
1035
+ // Called from the native SDK
1036
+ private void onExternalUserIdUpdateCompletion ( string jsonString ) {
1037
+ if ( string . IsNullOrEmpty ( jsonString ) )
1038
+ return ;
1039
+
1040
+ // Break part the jsonString which might contain a 'delegate_id' and a 'response'
1041
+ var jsonObject = Json . Deserialize ( jsonString ) as Dictionary < string , object > ;
1042
+
1043
+ // Check if the delegate should be processed
1044
+ if ( ! isValidDelegate ( jsonObject ) )
1045
+ return ;
1046
+
1047
+ var delegateId = Json . Deserialize ( jsonObject [ "delegate_id" ] as string ) as Dictionary < string , object > ;
1048
+ var delegateIdCompletion = delegateId [ "completion" ] as string ;
1049
+
1050
+ var response = jsonObject [ "response" ] as string ;
1051
+ var results = Json . Deserialize ( response ) as Dictionary < string , object > ;
1052
+
1053
+ if ( delegates . ContainsKey ( delegateIdCompletion ) ) {
1054
+ var externalUserIdUpdateCompletionDelegate = ( OnExternalUserIdUpdateCompletion ) delegates [ delegateIdCompletion ] ;
1055
+ delegates . Remove ( delegateIdCompletion ) ;
1056
+ externalUserIdUpdateCompletionDelegate ( results ) ;
1057
+ }
1058
+ }
1059
+
1035
1060
// Called from the native SDK
1036
1061
private void onSetEmailSuccess ( string jsonString ) {
1037
1062
if ( string . IsNullOrEmpty ( jsonString ) )
You can’t perform that action at this time.
0 commit comments