JSON error message appears before survey is closed within SurveyMonkey window on Android - surveymonkey

We defined a survey and are using SurveyMonkey SDK to display the survey on Android.
When a user choses to close the survey without proceeding, a white background containing the (correct) error code appears:
https://i.imgur.com/cavNtcr.jpg
Right after this is shown, onActivityResult() is invoked and the survey closes.
We looked into API and double-checked survey configuration for any debug options that might be enabled (or similar).
The following test case triggers the problem:
1. user opens a survey
2. user does not complete survey, but closes it instead by clicking the "X" button
Expected: Survey closes, SDK returns correctly:
{"error": {"reason": "user_exited_survey", "code": 200}}
Actual result: Survey is hidden, the error code that is expected is shown in the top-left corner of the WebView; after a few moments, the activity is closed and SDK returns correctly:
{"error": {"reason": "user_exited_survey", "code": 200}}
The user is able to see the JSON response for a few moments before the survey activity is closed, which is affecting user experience.
Is there any way to disable this text?

Related

Square Register API does not work. Is there a fix? [BUG]

I have a problem with the Square Register API (docs.connect.squareup.com/articles/register-api-overview/). I want to use the Square Register API in my Ionic 2 iOS app.
What I want to do
I want to send a JSON with the data about a purchase to the Square Point of Sale (Square POS) App. The documentation of the Square Register API says that this should be easy to do. The app should open and the check out process of the Square POS App should be triggered with the data given by the JSON request from my app. After the check out is completed the Square POS App should redirect to my app to a success screen. In this case the Square POS app should redirect to "summitapp://page-success".
The current status
I have registered my own Square App (connect.squareup.com/apps/) and did the configuration which is needed for an iOS app (connect.squareup.com/apps/{appname}/register-api) [appname should be replaced with the square internal id which I replaced for security reasons]
I also edit the info.plist to match the data from the Square Register API with the data inside my app. This works fine.
I also build the code to do the things I describe #"What I want to do". You can see the code at the button of this stack overflow post. I managed to send a request from my app to the Square POS App. The Square POS App opens, but immediately after it opened it redirects back to my app. It than shows this error message: Apple Pay is not available when using "Point of Sale"
I have also made a video showing you the behavior of the app:
https://www.youtube.com/watch?v=xLpSmV1XXJ8
In this video the error message does not appear, because I already had opened it and did the process the second time. The error message just appears once when the Square POS app is opened the first time by my app.
This error message I get is strange, because Apple Pay is not activated for the german market and I don't use it. I tried many different solutions. I added different possible payment methods and tried everything, but the only error message I got was the desired "Apple Pay Error Message".
To give you a bit of background what stack the app is build on, here is a short description: I am using Ionic 2 with an iPad Air 2 or an iPhone 7 Plus as a test device. On both devices the same error message occurs. Both devices run on the latest iOS 10 version and have installed the latest Square POS App. I use Ionic 2 (Version 2.2.1) and Cordova (Version 6.5.0).
What I tried
I already tried all the tutorials at Square:
LINK => docs.connect.squareup.com/articles/register-api-ios
And some advice I got from Stack overflow articles
LINK => stackoverflow.com/questions/41188031/square-connect-api-navigate-back-to-app
I also tried to build a iOS with the SDK, but also that doesn't work.
To give you an overview how the Square Register API is integrated into my code here is a short code snippet.
The Code looks like this:
let params = {
"amount_money": {
"amount": 100,
"currency_code": "USD"
},
"callback_url": "summitapp://page-success",
"client_id": "sq0idp-xyz", // here goes the client_id
"version": "1.2",
"notes": "Shopping cart",
"options": {
"supported_tender_types": [
"CREDIT_CARD"
],
"auto_return": true
}
};
let url = "square-commerce-v1://?data=" + encodeURIComponent(JSON.stringify(params));
let browser = open(url, "_system", "location=true");
My question / Where I need help
I don't understand why the app allay redirects me to my app without any interaction happening on the Square POS App. Any help how to implement the Square POS App in an Ionic iOS app would be awesome.
I don't know if the bug is on the Square Register Apps side or on my side. If you know anything about this issue or if you can show me a working sample code of an iOS app which can open the Square POS App from another app and then do the check out based on the data provided by this app I would appreciate your comment on this stack overflow post.
I already check out the different tutorials and nothing worked. I hope to find someone who can help me fix that problem. I am decently going to write a blog post about this, because I think all people wanting to implement the Square Register API face the same problem.

Facebook log in page in swift

When I try log in in my application with Facebook, I have page in Safari browser with text: You already have authorization PPFF. Or Are you want to have authorization in PPFF?
Also there is the gear on top of the text instead of the application logo. How I can change gear on my logo and type Application name instead of PPFF?
This has been reported earlier and is by design. This dialog will always show up when you start the login flow for a user that is already logged into your app.
You also can't change the appearance of the dialog unfortunately.
You can find the original report here: https://developers.facebook.com/bugs/1024399197610999/
Thanks.

XHR Requests only start when tab is focused on IOS 7 Safari

Following use case:
User clicks button on tab 1
App opens popup tab 2 (about:blank)
Severeal XMLHttpRequest occur between app on tab1 and server
App uses that info to create a form POST request from tab1 with target=tab2 (action is another origin, eg. paypal)
Tab 2 loads form response
etc
This works pretty much anywhere. On iOS Safari 7 it seems not.
On iOS Safari 7, the popup opens but stays on about:blank, because the XMLHttpRequest doesn't start because the tab1 at that point is no longer focused (the browser shows tab2).
If the user switches back to tab1, the execution resumes and everything works. (but that's not really intuitive).
I cannot create the XMLHTTPRequest before opening the popup, because the popup has to be created as a direct consequence of a user action or it will end in the popup blocker. Therefore the flow "user click starts request, request callback opens popup" does not work.
Is there a way around this limitation other than restructuring the whole app (eg. loading the http requests from the popup)?

Using OAuth.io iOS library to log into FitBit snag

following OAuth.io simple two lines
OAuthIOModal *oauthioModal = [[OAuthIOModal alloc] initWithKey:PublicKey delegate:self];
[oauthioModal showWithProvider:#"fitbit"];
throws up the web view, with the proper FitBit page.
YAY
I fill in the email & password, tap "allow".
I then get the "green check" with the happy message "Authorized"..
--THEN-- the FitBit page says "please return to [The App] and enter the following PIN when requested".
problem 1) We're in [The App].. we never left it.. we're in a web view. there's no returning to the app
problem 2) Copying a PIN? that's really inconvenient.. especially on a mobile device. why can't it just be returned in a callback in the http param? Like Facebook SDK, like Twitter, like Instagram?
problem 3) because of 1), there is no button, no callback execution, the only thing that can be pressed is the X in the OAuth.io view controller
problem 4) the didFailWithOAuthIOError: delegate method gets called with 'user cancelled'.
it seems like something really simple is missing, but everything seems correct up until the "show with provider" call.
please help
When you register your app on Fitbit you should select Application Type "Browser". This will authenticate without the use of a PIN.

Prefilled data in facebook web dialog

Is there any way i can prefill any string in FBWebDialog? Any workaround would do,I am aware facebook has deprecated the message parameter from their sdk.
My scenario is user clicks on a facebook contact
FBWebDialog opens and then the message gets prefilled with some text instead of a blank textfield.
any help would be appreciated
Thanks
Okay, from the comments it sounds like you want to post on the user's wall. Here is a method that is available in the FB SDK that pulls up a share dialog within your app and supports pre filled text
[FBDialogs presentOSIntegratedShareDialogModallyFrom:self initialText:#"Initial text" image:nil url:nil handler:nil];
Example with pre filled text:
Which type of dialog are you opening? (Sounds like the Send dialog, if you want to send a Facebook message.)
I do not think it is possible to even send a message directly to a user from iOS. When performing the following I get the error "This dialog is not available on this device"
[FBWebDialogs presentDialogModallyWithSession:nil dialog:#"send" parameters ...
iOS FB SDK WebDialog reference shows the following methods:
+ presentRequestsDialogModallyWithSession:message:title:parameters:handler:
+ presentRequestsDialogModallyWithSession:message:title:parameters:handler:friendCache:
Those seem to support pre-populating the message field. They only support apprequests though (not messages) and whether the message is even attached is a bit unknown (all I saw when testing was "User wants you to try App", not the actual string I set).
The javascript API (which could maybe be pulled up in a webview?) doesn't have a parameter to set the message probably because the Send dialog documentation says:
Facebook messages are a channel for person-to-person communication,
and not for apps to send messages, or encourage people to spam their
friends.
If you just want to post a message/share then you can use a share sheet which looks to support an initial message:
[FBNativeDialogs presentShareDialogModallyFrom:self initialText:#"My text to share" ...

Resources