ios programming doubts

hi all,


i have lots of questions, for which i did not get any answers from other firums. request your help for below doubts. it's ok to say "not possible" 🙂


My application pairs with a bluetooth device using obj c code. Everything works fine except that in between the wizard, system pops up an alert "do you want to pair with this device ? yes no". is there a way to silently pair the device without showing this alert ?


I have a requirement in my application that If for some reason my application malfunctions or crashes while running, user needs to be able to send diagonistic data to customer support. Is ther any third party application available which does this ?


in my application, some colors are industry standard, which should not change. but when i go to settings and do "switch color settings", my app's control colors change. how to make my app independent of color change in settings ?


Is it possible not to change my applications font size when the font size changes in settings of ios {in accessibility settings} ? Any hack solution would also do. I observed that the control which takes default font (when i dont specify any,) they change by accessibility font change, but others where i dynamically assign font family and sizes, font size does not change on accessibility font change.


at the worst case, is it possible to figure out inside my app through objc code that my phone is running in accessibility mode, so that i can display an alert ?


I am required to wake up my application when bluetooth pairing happensin ios. I see that the ios app can listen to external accessory, can any gentle soul please throw light to docs or sample codes or work arounds please ? wake up means while the app is in closed state, not in background running.


my initial research pointed towards below links.


http://stackoverflow.com/questions/21446721/wake-up-ios-app-when-a-bluetooth-device-is-near-by

http://stackoverflow.com/questions/19932090/how-to-wake-up-ios-app-with-bluetooth-signal-ble


the last person's answer in both the posts indicate towards that it is possible. my doubt is for exactly what event i can wake up my application from closed state (i mean the user closed the app from background apps list ) ?



My further investigation revealed that in my app-info.plist, requiredbackgroundmodes is set to "App communicates using bluetooth"


Still the app does not receive any entry point when it is in stopped state upon bluetooth data arrival ! this is kinda baffling me.


should this go to didFinishLaunchingAppWithOptions ? should that be the entry point or something else ?


thanks

Wow, lots of questions there. I'll try and answer a few of them.


Bluetooth - don't know much there. I suspect user confirmation is always going to be required for pairing but don't have any personal experience. Can't help on the background modes questions.


There are lots of third party crash reporting libraries. I use Parse. There are others such as Crashlytics, Crittercism etc.


Read the Apple documentation on tintColor. There are WWDC sessions from 2013 (I think) where it was introduced with iOS 7. You should be able to set the tint color of anything you like in your app.


As you've noted, you need to explicitly set a specific font if for some reason you want to make your app more difficult to use for people with vision problems 😝 There is a system notification you can use (UIContentSizeCategoryDidChangeNotification) to detect the change at runtime.

See the answers below. Please feel free to mark as correct answer or provide more follow-up for clarification:


My application pairs with a bluetooth device using obj c code. Everything works fine except that in between the wizard, system pops up an alert "do you want to pair with this device ? yes no". is there a way to silently pair the device without showing this alert ?


No. Apple has a policy that all processes requesting special access to the device must get user permission.


I have a requirement in my application that If for some reason my application malfunctions or crashes while running, user needs to be able to send diagonistic data to customer support. Is ther any third party application available which does this ?


New apps can enable this using ITC and build settings. No third party libraries needed. Check out the following documentation.


in my application, some colors are industry standard, which should not change. but when i go to settings and do "switch color settings", my app's control colors change. how to make my app independent of color change in settings ?


You could set a color theme for your app in code and manage those themes in your own settings. Just set the control colors explicitly, though I think saving a set of color (themed) structs in user defaults would be a good way to maange your own themes.


Is it possible not to change my applications font size when the font size changes in settings of ios {in accessibility settings} ?


You opt out when you set the font sizes explicitly rather than using the new font theme classes (Headline, Body, Subhead, Caption 1, etc.)


Any hack solution would also do. I observed that the control which takes default font (when i dont specify any,) they change by accessibility font change, but others where i dynamically assign font family and sizes, font size does not change on accessibility font change.


at the worst case, is it possible to figure out inside my app through objc code that my phone is running in accessibility mode, so that i can display an alert ?


Check using these accessibility functions:


  • UIAccessibilityPostNotification
  • UIAccessibilityIsVoiceOverRunning
  • UIAccessibilityIsClosedCaptioningEnabled
  • UIAccessibilityRequestGuidedAccessSession
  • UIAccessibilityIsGuidedAccessEnabled
  • UIAccessibilityIsInvertColorsEnabled
  • UIAccessibilityIsMonoAudioEnabled
  • UIAccessibilityZoomFocusChanged
  • UIAccessibilityRegisterGestureConflictWithZoom
  • UIAccessibilityConvertFrameToScreenCoordinates
  • UIAccessibilityConvertPathToScreenCoordinates


I am required to wake up my application when bluetooth pairing happensin ios. I see that the ios app can listen to external accessory, can any gentle soul please throw light to docs or sample codes or work arounds please ? wake up means while the app is in closed state, not in background running.


Background mode behavior is discussed extensively:

Read through this documentation covering the 2013 WWDC 703 session on Core Bluetooth

Note: One user posted an update as follows:

* UPDATE 03/05/14 *

It looks like Apple has introduced a major update with iOS 7.1: now iOS will open your app for you if it detects a UUID that matches your app. The app only needs to be installed, it doesn't have to be running (logic in AppDelegate needed to answer the wake-up call).

my initial research pointed towards below links.


http://stackoverflow.com/questions/21446721/wake-up-ios-app-when-a-bluetooth-device-is-near-by

http://stackoverflow.com/questions/19932090/how-to-wake-up-ios-app-with-bluetooth-signal-ble


the last person's answer in both the posts indicate towards that it is possible. my doubt is for exactly what event i can wake up my application from closed state (i mean the user closed the app from background apps list ) ?


Check out the Core Bluetooth Programming Guide to see how you can set and work with the background modes.


My further investigation revealed that in my app-info.plist, requiredbackgroundmodes is set to "App communicates using bluetooth"


Still the app does not receive any entry point when it is in stopped state upon bluetooth data arrival ! this is kinda baffling me.


should this go to didFinishLaunchingAppWithOptions ? should that be the entry point or something else ?

The Core Bluetooth Programming Guide mentioned in the link above covers this in the section "Reinstantiate Your Central and Peripheral Managers"




thanks

Thanks JP and Tommie,


I feel like re-discovering joy 🙂 i had put these questions in macrumor and did not get a single answer, hence had to put here as a summery. looks like macrumor forums are dead.


nonetheless,

I wonder how i missed these accessibility functions, while reading accessibility APIs. As the document is not fully descriptive, I would supplement sme more questions.


Is it entirely possible to make my application entirely independent of accessibility settings ? I use red color for a signal status in the control. Now when I do invert color from settings, my red color control is something else ! which is semantically wrong. Is it possible to make my control or drawing un-affected by these accessibility change ?


@Tommie, request to elaborate the statement


You opt out when you set the font sizes explicitly rather than using the new font theme classes (Body, Subhead, Caption 1, etc.)


did you mean only font types Body, Subhead, Caption 1 are prone to change in font settings ? not others, like System font of size 32 ? I am curious, what is the reason ?



regarding blootooth, i have gone through the documentation, and background modes. those are already implemented in my application and works.

the thing that I am after is "to wake up application from forced-kill [swipe up from list of background apps] state on pairing or data - send {if already paired}" which looks like is not possible at the moment. Pls correct me if i am wrong.


the color change solution is most important 🙂

thanks for the helps

If you take a look at the ASCIIWWDC website and search Core Bluetooth, you will find session 703 from WWDC2013. They discuss there that the system will take a snapshot in the background of your process and all of its connections and should any peripheral attempt to access those services offered by your process then your app will be brought back into the background for a brief period. You then have to do something with the inbound inforamtion. The website is not coming through on my other answer so here it is w w w . a s c i i w w d c . com (remove spaces).


While you are on that site, you should take a read of:

Usable by Everybody: Design Principles for Accessibility on Mac OS X


Regarding Font Sizes Clarifcation:

Setting a UIFont with a specific size will return a font at exactly that size while if you want to use dynamic text (or avoid it) there is a specific article on how that is enabled: (which shows by definition that if you do not enable it, you will have the specific size returned from a UIFont initializer).

For font on a label be sure to review: adjustsFontSizeToFitWidth

Check out the UIFont header file in Xcode (Cmd-Click on the word UIFont)


Fix the spacing and put this text in google to find the correct article. This will illustrate everything you need to know about the Dynamic Text features.

Supporting Dynamic Type site: useyourloaf . com


If the answers have helped please mark them by clicking the links. It will encoruage others to participate in your questions in the future.



BTW - You can take the content on the asciiwwdc website and paste it into translate . google .com (fix spaces) to read it in most other languages.

ios programming doubts
 
 
Q