Custom keyboard in chat with bot - telegram-bot

I have a bot. In a chat with a bot, a custom keyboard is used. When I delete only a bot message in a chat, the custom keyboard disappears, does not close, but it disappears. When I delete only my messages in this chat, the keyboard does not disappear. As I know, a custom keyboard should be constant until the bot sends a new custom keyboard. Is this a bug?

Let's look at API for message, it says that inline keyboard is connected to a "message it belongs to".
This behaviour seems normal, when keyboard disappears when message it belongs to has been deleted.

Related

Swift: Listen for global shortcut on specific keyboard

Is there any way on macOS to register global shortcut on specific keyboard?
I'm writing small app for turning my second keyboard into a "macro keyboard", but cannot find any way to determine which keyboard sent a shortcut.
For example, I'd like to intercept "A" button press on the second keyboard, and don't send that key to the foreground application.

How to find out style of NSUserNotification during run-time? Or force close an alert?

According to OS X Mountain Lion Release Notes:
"The user has ultimate control over what notifications are displayed, and the style (banner, alert, etc). There is no mechanism to override the user preferences."
Even though all I want to do is "downgrade" from alert style to banner style... Fine. But can I at least find out whether a notification is of alert or banner style inside the didActivateNotification method?
When the alert is a banner (which is what I want), clicking its contents is the only possible action, and this both triggers didActivateNotification method with notification.activationType value of NSUserNotificationActivationTypeContentsClicked and closes the notification banner. I want my app to respond to this action by opening an internet URL.
When the user chooses alert-style notifications, clicking the alert contents also generates didActivateNotification with the same value of notification.activationType, but it stays on screen instead of going away (it only goes away when the Action button is pressed, and notification.activationType has a different value then). I don't want my app to trigger an action repeatedly for the same alert notification, in case the user clicks the content area of an alert notification.
An alternative solution would be to force the alert notification bubble to dismiss when the user clicks its contents. Is this possible?
You can remove the notification with the following:
[[NSUserNotificationCenter defaultUserNotificationCenter] removeDeliveredNotification:notification];

ios5 notifications alert style

Is there any way to set the alert style for notifications via programming in ios5?
My app uses notifications that have actions and I do not want to put those notifications as banners. The flow of the app is dependent on the push notifications that arrive.
So I was finding a way by which I could set the alert style of the notifications to "Alerts" rather than "Banners". Any way to do that?
No, your app cannot control this. It is up to the user to decide how he wants your notifications to display. But why does it bother you? Clicking on the action button (aka "View") or clicking the notification itself in Center is similar in behavior regarding your app's code.

Is there a notification on iOS if a UIAlertView is shown?

Wondering if there is a notification available if a UIAlertView pops up?
Background: my app asks the user for a PIN after a period of inactivity but I would like to prevent it if an alert is on screen.
I don't want to go through my code and find all alerts and disable the PIN checker, instead a notification would be awesome. Any hope with NSNotification?
Just found the answer. It is hidden in here:
Can I get message when I show UIAlertView
If you listen to the "UIWindowDidBecomeVisibleNotification" notification, it will also fire for your own alerts, not only for system alerts.
For your own alerts, the application does not resign activiation however.

Send app to background on button tap

In my apps there is a button named "Back". When the user clicks on that button, the apps should be sent to the background, like when we click on the home button.
Even if you manage to do this, it is against Apple's HIG (because it will look as a crash to the user) - if you plan to publish your app on the AppStore you'll be rejected.
I think turning to background is impossible.
Make user press home button by using UIAlertView with no cancel button.
We can send an application to the background using SpringBoardUI or the SpringBoardServices private frameworks.
However, Apple won't accept this on the App Store.