Android Pinterest SDK: PinIt button no longer functioning - android

We noticed the Pin It button is no longer working within our application. Pressing it doesn't result in anything occurring.
The PinItListener doesn't get any exception callbacks, but it returns false for whether it was pinned in onComplete.
Trying out the PinItDemo project bundled with the SDK, nothing occurs on click either. I tried it with our client ID and a new client ID I set up.
Since it stopped functioning between releases of our application, I'm assuming it's a Pinterest change. Did a Pinterest update break the PinItSDK? Is there something we can do to fix it?

I'm not sure if PinItSDK doesn't work anymore or what the problem is. But there is another way you can pin the content. You can use the base url to open Create Pin form like
http://www.pinterest.com/pin/create/button/?media=http://www.ournorthstar.com/wp-content/uploads/2013/10/test1.jpg&title=Sample&description=This+is+a+test+description
and pass it as an intent and start the activity.
Eg:
String shareUrl = "http://www.pinterest.com/pin/create/button/?media=http://www.ournorthstar.com/wp-content/uploads/2013/10/test1.jpg&title=Sample&description=This+is+a+test+description"
Intent myIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(shareUrl));
startActivity(myIntent);

This issue was fixed in Pinterest for Android 2.1.4

Related

Launch Flutter to Specific screen from Kotlin native side plugin

I have Flutter plugin
That shows fullscreen notification from background or when terminated using Push notification
This screen is built in Kotlin
and it has a button that when pressed
it launch the Main Intent of the application - the code in that plugin is the following
ACTION_CALL_ACCEPT -> {
saveCallState(callIdToProcess!!, CALL_STATE_ACCEPTED)
channel.invokeMethod("onCallAccepted", parameters)
var launchIntent = getLaunchIntent(context!!)
launchIntent?.action = ACTION_CALL_ACCEPT
context.startActivity(launchIntent)
}
this works fine and it launch the application to the default route
I want it to open specific screen instead , also if there is a way to pass the parameters to this screen
I don't know if this can be achieved with channel.invokeMethod
because this is in the plugin side , I cannot run Navigator inside it's Dart code (NO context available there)
I only know basics of Kotlin that's why I don't know how to achieve this properly
Thanks in advance .

Plaid Sandbox Android APP Program Keeps Refreshing

The code that I'm using was imported directly from this example code:
https://github.com/plaid/link/tree/master/webviews/examples/android
When I run the app in Android Studio on a Nexus 5X emulator I see this:
Empty Menu
It then goes to the loading screen:
Loading
The app then switches between the two as if it were constantly refreshing. I see the empty menu then the loading screen pops up, then back to the empty menu then loading screen again.
I'm very new to Plaid so there might be something very simple that I'm missing but thanks for the help!
In the initialize link step, replace [PLAID_PUBLIC_KEY] with the public key provided to you. If you haven't registered for an account with Plaid, you have to do that first.
linkInitializeOptions.put("key", "[PLAID_PUBLIC_KEY]");
An HTTP request is sent with the public key, and the shouldOverrideUrlLoading function will keep getting called upon response without a valid public key, perpetuating the refresh cycle that you see.

How to open common incomplete products link with different toolbar in android studio

I have an eCommerce website and that has been running as an android app using WebView method. I have basic knowledge in android studio but not depth. My concern is wanna open Second Activity from Main Activity when user clicks on any product in app that contains link as "https://www.ecommerce.in/product/XXXXX". Here "https://www.ecommerce.in/product/" is common to all products but "XXXXX" will change to every product when user clicks on different products and this Second Activity should open using another toolbar without related to Main Activity toolbar and my code is like this:
webView.setWebViewClient(new ourViewClient()
{
public boolean shouldOverrideUrlLoading(WebView view, String url)
{
if(url.contains("https://www.ecommerce.in/product/XXXXX"))
{
Intent intent = new Intent(MainActivity.this, ProductsActivity.class);
startActivity(intent);
}
}
});
This code is not working at all. Hope, I get a solution for this and thank you for your help in advance.
First, it looks like you're trying to filter out links with a contains:
if(url.contains("https://www.ecommerce.in/product/XXXXX"))
But you've made it too restrictive. It is literally looking for "XXXXX" in the URL. Also, this doesn't really get you much in terms of security. WebViews are very dangerous. I'd suggest looking through this link for some basic suggestions.
Anyways, if you just want to open the ProductActivity it looks like all you have to do is update the test as follows:
if (url.startsWith("https://www.ecommerce.in/product/"))
Note if you need that URL then you have to pass it to the ProductActivity as part of the intent and grab it in the ProductActivity, but be sure to verify the URL before just loading it to make sure sit starts with the common part.
It might be that someone is trying to get your Activity to do things it shouldn't be.

Detect address bar changes firefox android extension

I'm working on a firefox for android addon, and there is a function that i need to be fired every time a new page (tab) is loaded: a new tab is opened or the address of the current tab changes. I tried to use listener ("load"/"tabSelect") but the first one didn't work and the second doesn't detect the address bar changes:
window.BrowserApp.deck.addEventListener("load", onPageLoad, true);
Should I add more than one listener? and I found this, but it doesn't work for firefox for android. Thank you for your help.
I don't know why "load" is not working for you. I do know that "load" is sometimes not called, when loading a page from back/forward session history for example. To work around that, you could try using the "pageshow" event. That will be called for any page-change.
For more info see: https://developer.mozilla.org/en-US/docs/Code_snippets/Mobile

Recent Apps on UiAutomator

I am now working with Android UiAutomator on for UI Test on my Android app. My app has a function that requires the user to verify the email to continue, so I try to do it like this: after reach to that function -> getUiDevice.pressHome -> Browser -> try to log in email -> PressHome again -> Press RecentApps then I stuck here, I cannot press on my Apps to return to it again. I try another way by clicking on my App icon but it starts my app again, not at the state before. Can anyone suggest me a solution for this? Any help is appreciate.
Thanks in advance.
Try this :
UiObject appBackground = new UiObject(new UiSelector().description("ABC"));
appBackground.click();
It did not show any description through 'uiautomatorviewer' command but this worked for me.
I could manage to create this behavior with:
fun backgroundAndForeground() {
val device = UiDevice.getInstance(getInstrumentation())
device.pressHome()
// Pressing app switch two times makes the last app put on background come to foreground.
device.pressKeyCode(KeyEvent.KEYCODE_APP_SWITCH)
device.pressKeyCode(KeyEvent.KEYCODE_APP_SWITCH)
}
In this case, I think that android only resume app when clicking the recent app image. It does not work on clicking display text or app icon. So, we need to click image of your app in recent app list. At that time you need to write as below. I always do that for similar case.
// Take all image view by class type and click by instance no.
new UiObject(new UiSelector().className("android.widget.ImageView").instance(3)).click();
You need to count instance no of your recent app image view. Not app icon image in recent app scroll view. Please try this. Thanks.
I've spent half a day on this and concluded I needed to issue a device.click(). Since my use-case is that my app was the last one running (not switching to the browser like you), I can safely click the middle of the screen and it'll always work.
If you're the 2nd to last running app, you can probably do x: 0 and y: device.displayHeight/2.
I've not tested this on many operating systems, only 9.

Categories

Resources