Is device_data always provided in a call back? - paypal

When using the PayPal JS v2 SDK, we usually a get device_data parameter in the call back.
I wasn't able to find any reference to this parameter, except in the Braintree::Transaction.sale documentation.
In production we intermittently see that no device_data parameter comes with the call back.
Is this expected behavior?
What causes it, and are there any implications?
Should we simply omit passing device_data on to Braintree::Transaction.sale?

device_data is a piece of parameter that contains various information about the customer device for fraud detection. Things like, device_session_id, fraud_merchant_id, correlation_id will be part of the device data. All these information are for fraud detection and risk information.
This is something which you should provide whenever you look for support in the future.
I am not sure if this is an issue/intended to have no device_data returned in the callback, perhaps you should give them a call at 877.434.2894 or email their Support team to check if there is an issue on this.
However, if you are not passing the device_data parameter in Braintree::Transaction.sale, I suppose that is fine. But the best practice is to have that piece of information.

Related

How do I access subscription data when using MonitoringMode.Sampling?

I'm trying to find out how to use Eclipse Milo, and finding out how subscriptions go. I can easily get any MonitoringMode.Reporting mode subscription to work, but when I use Sampling it doesn't call the callback method (as expected). According to the docs it's supposed to "queue" up the values without calling the callback, but I can't find any place I can access that queue or anything similar. The UaMonitoredItem doesn't have anything in its interface that looks like it, neither does the request.
It's probably something obvious, but what am I doing wrong?
Thank you in advance!
Answered in the GitHub repo discussions, but for posterity:
MonitoringMode.Sampling simply means the server continues to sample the underlying but does not report the values to the client.
The queued values are not available to you. If you change back to MonitoringMode.Reporting then they would be the first values reported for that item.

Intent not fired in device but works fine in simulator?

I am developing action for assistant. I have intent in dialogflow that is fired correctly in simulator but does not get fired in a real device rather fallback intent is triggered ?
What puzzles me more is the intent works fine with one email id but does not work with another email id on the same device ?
I highly doubt the issue arising from language preferences.
It is really difficult to diagnose issues like this with only generic information. To really help, we'd need to see specifics of the Intent and examples where it doesn't get triggered where you expect it to. But a few things to consider:
If the sample phrase uses homonyms like "to/two/too" or "four/for", it can be picked up incorrectly.
You don't indicate if this is spoken or typed where you have the problem. You may want to look at the entries at https://myactivity.google.com/ to see how it hears what you're saying.
Check the Dialogflow "History" section to see if it provides any guidance on what it is getting and why it is choosing the fallback intent.

How to know if "disableInitialLoad" was called on GPT?

I need to know if googletag.pubads().disableInitialLoad() was called, in which case I'll load an ad using a display and a refresh calls, otherwise I'll load it using just display. My assumption is that if I always call display plus refresh I will get 2 ad requests unless disableInitialLoad had been called.
Is it possible to know that?
There is an undocumented variable on pubads that internally saves the state of disableInitialLoad, because it is undocumented you have to use it under your own risk.
the variable is window.google_DisableInitialLoad
Hope it is still usefull to you.
There is a method in GPT for doing this which is: isInitialLoadDisabled()
And as Claudio wrote - it's good practice not to use undocumented variables.
Undocumented variables might not do exactly what you think they do - and their behaviour might change at any point (see avoiding common GPT implementation mistakes).

How to use Trampoline IOS

I was looking for this on google and I found some articles on it They say it is used for HigherOrderMessaging and I tried to read the code to but everything was over my head can any body give simple example of it how we can use them? They were saying its used for passing returned object from method to another object. And another question when I develop apps never came situation where I need to use something like this.
In Objective-C, a trampoline is an object returned by a method that exposes some kind of message interface. When messages are received, it bounces the message on to another object.
Example One:
Return a proxy of a service client. When methods are invoked on the proxy, it first checks if the user has permission to proceed.
Example Two:
Make all the objects in an array do something:
[[windowsArray do] setHidesOnDeactivate:YES];

iOS: Can openURL ever be nil?

For -[UIApplicationDelegate application:openURL:sourceApplication:annotation:], can the URL ever be nil? I'm asking because I saw someone put in a check if (url) // ..., but isn't that unnecessary? I.e., doesn't this method always get called with a non-nil NSURL argument for openURL?
Assuming an external invocation (ie from another app trying to open yours), then I would assume it is non-nil, however perhaps (unlikely I know) you call it internally in which case it might be?
Assumptions however are dangerous!
It would therefore seem prudent to sanity check the value before doing something that might cause a crash should the value be nil.
Seems OK to check if you ask me.
According to Apple Documentation, the url parameter is:
A object representing a URL (Universal
Resource Locator). See Apple URL
Scheme Reference for Apple-registered
schemes for URLs.
You have to register your application to accept specific URLs.
This article shows how it is done.
This would lead me to believe that this method would not be called unless it adhered to a URL Schema specified by the application.
If it is being called internally, than you would know whether you would need to check for nil or not. As for an outside application calling it, I can't see how that would happen.