Fellow SO members,
I am trying to figure out how to get a callback from the Android Pinterest SDK, after a "pin it" event has successfully completed. I have implemented the SDK as follows:
PinIt pinIt = new PinIt();
pinIt.setUrl(socialContent.getLink());
pinIt.setImageUrl(socialContent.getPicture());
pinIt.setDescription(socialContent.getMessage());
pinIt.setListener(new PinItListener() {
#Override
public void onStart() {
super.onStart();
}
#Override
public void onComplete(boolean completed) {
super.onComplete(completed);
if (completed) {
handle Pin It form displayed=true event
}
}
#Override
public void onException(Exception e) {
super.onException(e);
exception handling code...
}
});
pinIt.doPinIt(getActivity());
Per the documentation, onComplete(true) gets called as soon as the Pin It form comes up. What I'm looking for is a way to get a callback when the "Pin It" event is successfully completed. So far, I have found now way to do this.
My iOS co-worker found that there was a way to register an app URI ("yourapp://blah") as a form of callback. I have found no such way to do this in the Android Pinterest SDK.
Does anyone know how to receive an event after the "Pin It" event is successfully completed?
Related
I implemented the snapchat login in my Android app by referring to the snapchat login kit sdk guide.
I refer to the below code that uses a custom button.
// Get the login API
SnapLogin snapLogin = SnapLoginProvider.get(getContext());
View yourButtonView = findViewById(...);
yourButtonView.setOnClickListener(new OnClickListener() {
#Override
public void onClick(View v) {
// Start token grant
snapLogin.startTokenGrant(new LoginResultCallback() {
#Override
public void onStart() {
// Here you could update the UI to show login start
}
#Override
public void onSuccess(#NonNull String accessToken) {
// Here you could update the UI to show login success
}
#Override
public void onFailure(#NonNull LoginException exception) {
// Here you could update the UI to show login failure
}
});
}
});
Call startTokenGrant api to complete authentication in snapchat.
After authentication, callback is called when returning to my app.
Step 1 goes well.
But intermittently, the callback is not called.
I thought this was an error in the sdk, but I saw that it works normally in other apps.
Has anyone had an experience where the callback never gets called?
If yes, please help how to solve it.
(I'm developing using dev clientId right now, will this have any effect?)
I have an Android app that allows casting remote URLs via Chromecast.
This works fine, but I'm trying to provide feedback to the user when casting fails.
Right now I'm unable to get any error feedback via RemoteMediaClient.Callback
The onMediaError() callback isn't called even when the URL provided doesn't exist and returns an error 404.
How I can know about those error to provide some feedback to the user?
I am not sure but can you set this callback on your RemoteMediaClient
MediaInfo.Builder mi =
bulider.setStreamType(MediaInfo.STREAM_TYPE_BUFFERED)
.setContentType("video/mp4")
.setMetadata(md)
.setCustomData(j);
remoteMediaClient.load(mi, true, seekTo).setResultCallback(new ResultCallbacks<RemoteMediaClient.MediaChannelResult>() {
#Override
public void onSuccess(#NonNull RemoteMediaClient.MediaChannelResult mediaChannelResult) {
Log.d("cast", "SUCCESS");
}
#Override
public void onFailure(#NonNull Status status) {
Log.d("cast", "FAILURE "+status.getStatusMessage());
}
});
trying to implement passwordless auth on android using auth0.
I can get auth0 to add a user/send them an using the below method:
.start(new BaseCallback<Void, AuthenticationException>() {
#Override
public void onSuccess(Void payload) {
}
#Override
public void onFailure(AuthenticationException error) {
}
});
onSuccess() is called if the network request happens successfully (all good).
Once a user clicks on the link in the email, it opens another activity - how can I intercept either a Credentials object, or use onActivityResult() in this activity? The documentation isn't very clear!
I'm implementing Facebook sharing feature in my app. I took the code from the example https://developers.facebook.com/docs/sharing/android (Share Dialog)
FacebookCallback is implementing 3 methods onSuccess, onCancel, onError.
shareDialog.registerCallback(callbackManager, new FacebookCallback<Sharer.Result>() {
#Override
public void onSuccess(Sharer.Result result) {
Timber.e("onSuccess " + result.getPostId());
}
#Override
public void onCancel() {
Timber.e("onCancel");
}
#Override
public void onError(FacebookException e) {
Timber.e("onError");
}
});
I want to know if user cancels share dialog instead of sharing content. But for some reasons onSuccess is called and result.getPostId() is null in both cases if user successfully shares content or cancels dialog. Why onCancel isn't called if user pressed back and why result.getPostId() is null even if post was shared successfully?
You will only get onCancel if the user has authorized your app (i.e. logged into Facebook via your app).
You will only get the postId if your app also has the publish_actions permission.
See https://developers.facebook.com/docs/android/troubleshooting#onsuccess
https://github.com/fusesource/mqtt-client
i have an android application starting a background service where i have initiated an mqtt connection towards an apollo broker. when startService is called im initiating the MQTT from the onStartCommand setting hostname, port username, password etc.. followed by
connection = mqtt.callbackConnection();
the connect is successfull and i can clearly see that i have a consumer on my topic "uniqueId".
But when i send messages to my topic , the listener never calles the onPublish.. Another strange occurence is that if i loose my connection towards the broker , e.g i shut down the broker so that the active connection is broken, when the mqtt-client reconnects, it seems that it calles the listener and also the onPublish because then all the messages that i have stacked on my durable subscriber topic is delivered.. am i missing anything here regarding the listener?
isnt it suppose to actively consume the topic due to connection.subscribe??
Topic[] topics = { new Topic("uniqueId", QoS.AT_LEAST_ONCE) };
connection.subscribe(topics, new Callback<byte[]>() {
public void onSuccess(byte[] qoses) {
}
public void onFailure(Throwable value) {
value.printStackTrace();
}
});
connection.listener(new Listener() {
#Override
public void onConnected() {
}
#Override
public void onDisconnected() {
}
#Override
public void onFailure(Throwable value) {
}
#Override
public void onPublish(UTF8Buffer topic, Buffer payload, Runnable ack) {
ack.run();
}
});
I'm not familiar with Apollo, but I agree that the behaviour sounds incorrect. You could try testing against another broker to see if it works as expected, then file a bug against Apollo if necessary.
You could use e.g. test.mosquitto.org:1883 to test against, or use one of the other public ones listed on mqtt.org/software