universal-tools / UTNotificationsFeedback

7 stars 0 forks source link

1. gpg conflict 2. receiving not encoded notification #110

Closed wththd closed 5 years ago

wththd commented 5 years ago
  1. I have gpg imported to my project and it downloads shortcutBadger-1.1.5. UT Notification also downloads me.leolin.ShorcutBadger-1.1.22 so you have to unload 1 library every time resolvers check
  2. I had older version of UT Notification and all pushes was right, But after 1.8.1 update they become unencoded, so i have to decode json i get in c# code. But in notification in home screen it sill has special symbols (like + not space, %22 and not ")
wththd commented 5 years ago
  1. Fixed in java source code plugin in manager.java

at postPushNotification method (start 404 line) add

try {
            title = URLDecoder.decode(title, StandardCharsets.UTF_8.name());
            text = URLDecoder.decode(text, StandardCharsets.UTF_8.name());
        }
        catch(Exception e){
            Log.d("Errors", "Error while decoding " + e.getMessage());
        }

at the end. Dont know why it didnot decode before

yuriy-universal-ivanov commented 5 years ago

@wththd ,

  1. Just delete the older version (1.1.5). The correct way of handling Android native plugins dependencies in Unity is using Play Services Resolver, which is exactly what we do. When all assets resolve their dependencies this way, it makes sure no duplications are made and compatible versions of libraries are chosen. Some obsolete (or just lazy) assets don't do it, which causes this type of conflicts. Just delete their library please.
  2. We had URL decoding before, but due to deeper integration with FCM we had to drop it. So just make sure you don't URL-encode when sending messages from your server, that's the right solution here. Modifying the native plugin might work too of course, depending on your specific use case (as we had to support many different use cases, it wasn't an option for us anymore).

Best regards, Yuriy, Universal Tools team.

wththd commented 5 years ago

@yuriy-universal-ivanov ty for answer. But i imported last version of google play games, i think they know what they are doing :) As a suggetion may be you can add some settings for encoding, because rebuilding plugin is not a good idea

yuriy-universal-ivanov commented 5 years ago

@wththd Are you really using the official plugin from Google? Can you please send the link to it so we could test our asset in the same project with it?

wththd commented 5 years ago

@yuriy-universal-ivanov https://github.com/playgameservices/play-games-plugin-for-unity/tree/master/current-build

yuriy-universal-ivanov commented 5 years ago

@wththd Clean project, importing UTNotifications and GPG (the one you referenced): only me.leolin.ShortcutBadger-1.1.22.aar, everything uses Play Services Resolver, everything is fine. I guess you got the other ShortcutBadger not from GPG (probably Unity failed to delete an old version of ShortcutBadger when updating UTNotifications). Feel free to delete the old one, it has nothing to do with either UTNotifications 1.8.* or GPG.