Skip to content
This repository has been archived by the owner on Dec 27, 2023. It is now read-only.

Android client receives 'undefined' when creating new Privly Content. #353

Open
vshivam opened this issue Feb 24, 2016 · 5 comments
Open
Labels

Comments

@vshivam
Copy link
Member

vshivam commented Feb 24, 2016

When creating a new PlainPost or Message, the receiveNewPrivlyURL() [0] method receives 'undefined' instead of a Privly Url on the client side.

Not sure if this is relevant but the applications on being loaded in the WebView also throw this exception :
setListener is called but is not implemented (current adapter: %s) -- From line 215 of file:///android_asset/PrivlyApplications/shared/javascripts/context_messenger.js

[0] https://github.com/privly/privly-applications/blob/master/shared/javascripts/context_messenger.js#L686

@vshivam
Copy link
Member Author

vshivam commented Feb 24, 2016

Based on some basic testing, passing data.body.privlyUrl to the receiveNewPrivlyURL() method works. I'm not sure how it effects everything else.

@smcgregor
Copy link
Member

I am confused how this could be broken on Android and not on the other platforms. Is there a problem with the newer context messenger?

@vshivam
Copy link
Member Author

vshivam commented Feb 26, 2016

The context messenger doesn't actually send 'undefined'. It sends the whole data object to the JS bridge. The interface however, only understands primitive types and strings which results in an 'undefined'.

As to what it does with the client does with the original Url and how it uses it, check this[0] out.

[0] https://github.com/privly/privly-android/blob/master/app/src/main/java/ly/priv/mobile/gui/fragments/ShowContentFragment.java#L208

@smcgregor
Copy link
Member

So privly-applications needs to serialize the object and we add a JSON deserialization library to the Android side?

@vshivam
Copy link
Member Author

vshivam commented Feb 29, 2016

Works for me. The other option would be to retrieve the Url from the data object and pass it on to the receiveNewPrivlyURL method.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants