Delaying display of push notification alert - ios6

All the code I've ever seen put the -[[UIApplication sharedApplication] registerForRemoteNotificationTypes:... in the AppDelegate's -didFinishLaunchingWithOptions:... and so the push alert is the first thing the user sees as he enters the app.
My goal is to delay it a little bit, i.e. show something and then in some viewDidLoad show user the alert.
Is it possible?
Another related question is will -didFailToRegisterForRemoteNotificationsWithError will be called if the user denies the push or just if something is wrong with the registration?
Thanks!

Well, I will answer my question after testing it with a test app (because mine cannot be uninstalled for the whole day, I have got work to do.. :) )
1) The alert CAN be delayed. the moment you call -registerForRemoteNotificationTypes, that moment the alert will show and the answer has to be given. The only way to dismiss that alert is to reboot the device, in which your answer to the alert is NO!
2) No, didFailToRegisterForRemoteNotificationsWithError is only called if something went wrong with the registration (certificates, etc.).

Related

Porting an Alexa Skill - completing or continuing the dialog

I have a skill in Alexa, Cortana and Google and in each case, there is a concept of terminating the flow after speaking the result or keeping the mic open to continue the flow. The skill is mostly in an Http API call that returns the information to speak, display and a flag to continue the conversation or not.
In Alexa, the flag returned from the API call and passed to Alexa is called shouldEndSession. In Google Assistant, the flag is expect_user_response.
So in my code folder, the API is called from the Javascript file and returns a JSON object containing three elements: speech (the text to speak - possibly SSML); displayText (the text to display to the user); and shouldEndSession (true or false).
The action calls the JavaScript code with type Search and a collect segment. It then outputs the JSON object mentioned above. This all works fine except I don't know how to handle the shouldEndSession. Is this done in the action perhaps with the validate segment?
For example, "Hi Bixby, ask car repair about changing my tires" would respond with the answer and be done. But something like "Hi Bixby, ask car repair about replacing my alternator". In this case, the response may be "I need to know what model car you have. What model car?". The user would then say "Toyota" and then Bixby would complete the dialog with the answer or maybe ask for more info.
I'd appreciate some pointers.
Thanks
I think it can easily be done in Bixby by input prompt when a required input is missing. You can build input-view to better enhance the user experience.
To start building the capsule, I would suggest the following:
Learn more about Bixby on https://bixbydevelopers.com/dev/docs/dev-guide
Try some sample capsules and watch some tutorial videos on https://bixbydevelopers.com/dev/docs/sample-capsules
If you have a Bixby enabled Samsung device, check our marketplace for ideas and inspirations.

During a dialog alexa responses with sessionEnd voice, without any reason

this is my use case:
i created a skill which includes a dialog model. This model aks the user for serveral slot values. Every slot value will then be checked if the answer is right or not. When ist right the dialog goes on, if not alexa aks the user again (via elicitslot). So my problem is, wehn i give a wrong answer, alexa ends the session without any reason, she does not fire the elicitslot direction.
The strange thing is, during tests bevor, everything worked finde. And then I just changed something on the interaction model (I added a slot) and then it does not work anymore.
Note: this affects only 4 of 10 slot values. For the other 6 values the elicitslot direction works fine. But for the other 4 not. And the problem is, i can't see anything in the logs. So i dont know why this happens.
The main problem is, in one run everything works and in the next it the elicitslot does not work for 4 slot values.
image with error
Here you can see it, "ziege" is not the right answer so normaly alexa should aks now "please try again...". But she ends the session, whyy???
image without error
And this is the slot bevor, there everything worked fine. "Schildkröte" is wrong, so alexa asks the user to enter the right value. This is all in the same session...
Are there any bugs which i dont know? Or hase it something to go with the slot types..?
Please its for my thesis, and in really need help.
Note: i work with the amazon lambda editor..

Prompt when trying to dial a phone number using tel:// scheme on iOS 11

I am facing an issue, while trying to start a phone call from my iOS app using:
UIApplication open(_:options: completionHandler:)
iOS shows an confirmation popup/alert before starting the call with two button Call & Cancel and CompletionHandler called with a Bool parameter having true/false based on button action in iOS 10.
But now in iOS11 the problem is that the completionHandler is being called automatically before tapping on "Cancel" or "Call" button of confirmation popup, always having true value.
Is this a bug in iOS11 or is there something that I am doing wrong?
There has been a behavior change in when the closure is called in iOS 11. I cant say if this behavior will be reverted or if this is a bug.
But one of the ways you can identify when the user interacted with the popup is by adding a notification listener around UIApplicationDidBecomeActive in the completion closure of openURL(). To identify whether the call was clicked or not you will need to create another custom notification and listener on the CTCallCenter. That was the best way through which I was able to identify it, there might be better solutions though :D
completionHandler will get a call if your given URL gets open success or failure, this has nothing to do with Cancel & Call buttons on Alert
see what Apple docs has to say about it HERE
completionHandler
The block to execute with the results. Provide a
value for this parameter if you want to be informed of the success or
failure of opening the URL. This block is executed asynchronously on
your app's main thread. The block has no return value and takes the
following parameter:
success
A Boolean indicating whether the URL was
opened successfully.

Nothing happening when I click Post Comment button (ThinksterIO:Real Time Webapps tutorial)

I ran into another snag while going through the ThinksterIO Learn to Build Real Time Webapps tutorial around the 90% mark where one is shown how to add and delete comments:
https://thinkster.io/angulartutorial/learn-to-build-realtime-webapps/#adding-comments-functionality-to-the-post-service-9
Every time I click the Post Comment button absolutely nothing happen and I simply can't figure it out. I am expecting some kind of error to show up but nil. It's as if the button is not hooked up to the function. I was so frustrated that I eventually just copy and pasted the code from the tutorial to make sure I had it down right. Even after doing that it still didn't work.
I've created a Plunker with this app running over here http://embed.plnkr.co/OhzDTU/preview
You can sign in with the email user#user.com and 1234 password. You will then be able to try to comment on posts. Any ideas on what is going wrong here?
UPDATE
I took away the user user#user.com and 1234 password since problem is now fixed.
Your add comment button is in showpost.html, which is rendered by PostViewCtrl. However, your addComment method is attached to the scope of PostsCtrl (it doesn't exist when you try to click it). The simplest answer here is just to move addComment() over to the other controller.
Regarding the lack of error messages, I don't think that you can get an error for this. I had a look at the docs for $log and tried to decide if you could add some debugging output, but it looks like it's already on (i.e. the lack of a method seems to fail silently).
About your only option here is to try something like {{addComment|json}} in the view to see if it exists, but you'd first have to suspect that it didn't.

How to prevent user from entering data more than once(NSDate)

I would like to ask for suggestion about the following matter: let's say i have an app where the user enters data each day in an iphone(data stored with core data) and I would to prevent the user from adding data more than once for a same, how could that be done in the viewcontroller?
Thank you,
You can disable the UI, that lets the user enter data after it has been done already for the day. Other than that, it totally depends on your code and logic of the app. It is up to you as the engineer/programmer to implement a way so that the data cannot be changed more than once.
Good luck!

Resources