Category: iOS

Why does the iOS App Store show more languages than my app supports?

By default, the languages of an app are listed in info.plist by setting the values for the properties list key CFBundleLocalizations. A definition as shown below should result in supported languages English and German.

	<key>CFBundleLocalizations</key>
	<array>
		<string>en</string>
		<string>de</string>
	</array>

But when looking at the AppStore, the languages shown there do not always correlated with this setting. The reason is that the languages shown on the AppStore are generated automatically based on the localized *.lproj folders found in your app.

Normally those folders should be in sync with your properties list setting. But when you use third party libraries (e.g. with CocoaPods) additional localizations might be loaded into your app. In this case, all *.lproj folders found in your app and in the pods are used for language determination.

How to correct the languages?

There is a plugin for that: cocoapods-prune-localizations, which can be simply added to your Podfile. When running pod install, this script will remove all localized files from pods or just keep the specified languages. To install the script, run:

gem install cocoapods-prune-localizations

Then add the following lines to your Podfile:

plugin 'cocoapods-prune-localizations'

Localizations will be inferred from your project.

or if you would prefer to specify the localizations:

plugin 'cocoapods-prune-localizations', {:localizations => ["en", "es"]}

This will keep the English and Spanish localizations in the Pods. Modify the localizations to your needs.

Photo by Etienne Girardet on Unsplash

 

Build and Release a Flutter App

Updating the app’s version number

To update the version number, navigate to the pubspec.yaml file and update the following line with the current version string:

version: 1.0.0+1

After the change, run:

flutter pub get

Build and release the iOS app

A detailled description of the whole process is described at docs.flutter.dev.

To release the iOS app, you use Flutter to build a xcarchive file. This build archive can be published the same way you would do it with Xcode by using the archive manager and one of the different Distribution options.

Build the iOS app:

flutter build ipa

The generated xcarchive file is saved to your app directory under:

/build/ios/archive/MyApp.xcarchive

Build and release the Android app

A detailled description of the whole process is described at docs.flutter.dev.

To release the Android app, you use Flutter to build a app bundle aab file. This file can be distributed by using Google Play Console or any other store.

Build the Android app:

flutter build appbundle

The generated aab app bundle file is saved to your app directory under:

/build/app/outputs/bundle/release/MyApp.aab

Photo by Artur Shamsutdinov on Unsplash

 

Join Note to Self Mail beta testing

TestFlight

You are already using Note to Self Mail and want to test new features and check out the latest improvements? The TestFlight service of Apple provides an easy way to do so. You can join TestFlight by opening this link:

Invitation link to join the TestFlight of Note to Self Mail:
https://testflight.note2selfmail.app/

What is TestFlight?

TestFlight is a service by Apple that …

Help developers test beta versions of their apps and App Clips using the TestFlight app. Download TestFlight on the App Store for iPhone, iPad, and Apple TV. […] To test beta versions of apps and App Clips using TestFlight, you’ll need to accept an email or public link invitation from the developer and have a device that you can use to test.

https://testflight.apple.com/

To learn more about TestFlight, how to get started an dhow to install and test beta apps, just open https://testflight.apple.com/.

You want to support this app?

Note to Self Mail - The fastest app to send your ideas into your inbox. | Product Hunt

Photo by Erol Ahmed on Unsplash

UX improvements: `enterkeyhint` to define action label for the keyboard of mobile devices

Usability

The enterkeyhint is a html attribute described in the HTML standard, which can be used to improve the context of action buttons of keyboards on mobile device.

The enterkeyhint content attribute is an enumerated attribute that specifies what action label (or icon) to present for the enter key on virtual keyboards. This allows authors to customize the presentation of the enter key in order to make it more helpful for users.

It allows the following fixed values: enter, done, go, next, previous, search and send. Let’s have a look at those values and the resulting keyboard style on iOS:

<input>

The default behavior without any value.

<input enterkeyhint=”enter”>

The user agent should present a cue for the operation ‘enter’, typically inserting a new line.

<input enterkeyhint=”done”>

The user agent should present a cue for the operation ‘done’, typically meaning there is nothing more to input and the input method editor (IME) will be closed.

<input enterkeyhint=”go”>

The user agent should present a cue for the operation ‘go’, typically meaning to take the user to the target of the text they typed.

<input enterkeyhint=”next”>

The user agent should present a cue for the operation ‘next’, typically taking the user to the next field that will accept text.

<input enterkeyhint=”previous”>

The user agent should present a cue for the operation ‘previous’, typically taking the user to the previous field that will accept text.

<input enterkeyhint=”search”>

The user agent should present a cue for the operation ‘search’, typically taking the user to the results of searching for the text they have typed.

<input enterkeyhint=”send”>

The user agent should present a cue for the operation ‘send’, typically delivering the text to its target.

Photo by Melisa Hildt on Unsplash

Xcode fails to generate source files from intent definition files when using the Legacy Build System

The workaround for this problem is the following: First, add a Run Script phase before the Compile Sources phase of your target:

xcrun intentbuilderc generate -input ${SRCROOT}/PATH/TO/Intents.intentdefinition -output ${SRCROOT}/Intents -classPrefix "" -language Swift -swiftVersion 5.0

Then, add all of the generated files from the output path specified in the command above to all required targets in your project.

Source: https://developer.apple.com/documentation/xcode_release_notes/xcode_11_4_release_notes

Background tasks in iOS

As already discussed in Background task in iOS action extension, it sometimes becomes necessary to perform time consuming tasks in the background. This is really important, if such a task would block the user interaction. Especially for action and share extensions, this might lead to some waiting time before a task completes and the extension disappears. After several attempts to realise a working solution, the following code help to extends an App’s background execution time.

This code was described in the article Extending Your App’s Background Execution Time.

Extending the background execution time in an app

func performTask()
{
   // Perform the task on a background queue.
   DispatchQueue.global().async {
      // Request the task assertion and save the ID.
      self.backgroundTaskID = UIApplication.shared.
                 beginBackgroundTask (withName: "Perform Long Task") {
         // End the task if time expires.
         UIApplication.shared.endBackgroundTask(self.backgroundTaskID!)
         self.backgroundTaskID = UIBackgroundTaskInvalid
      }
            
      // Run task synchronously.
      self.performLongTask()
            
      // End the task assertion.
      UIApplication.shared.endBackgroundTask(self.backgroundTaskID!)
      self.backgroundTaskID = UIBackgroundTaskInvalid
   }
}

Extending the background execution time in an extension

func performTask()
{
   // Perform the task in background.
   let processinfo = ProcessInfo()
   processinfo.performExpiringActivity(withReason: "Long task") { (expired) in
      if (!expired) {
         // Run task synchronously.
         self.performLongTask()
      }
      else {
         // Cancel task.
         self.cancelLongTask()
      }
   }
}

As mentioned in the documentation, the ProcessInfo code block is called a second time if the system need to suspend the process:

If your block is still executing and the system need to suspend the process, the system executes your block a second time with the expired parameter set to true. Your block must be prepared to handle this case. When the expired parameter is true, stop any in-progress tasks as quickly as possible.

Source: https://developer.apple.com/documentation/foundation/processinfo/1617030-performexpiringactivity

Important: it’s important that the tasks are executed synchronously. When the end of the block is reached, the thread will terminate and end the execution of your task. If your tasks are asynchron, you can use a loop like shown below to wait inside the background thread until the asynchron task is finished:

// Keep background thread alive until asynchron task ends.
repeat {
    sleep(1)
} while(taskIsRunning)

General thoughts on using background tasks in iOS

A good summary of background tasks is available at https://forums.developer.apple.com/thread/85066


Photo by Jonathan Borba on Unsplash.

Note To Self: how to instantly create tasks in Trello

If you are using the mail import feature of Trello, you can speed up the notes with Note To Self Mail. The app creates notes in Trello in seconds.

Setup Note To Self Mail for Trello

1. Get your Trello email address

Get your Trello email address by open up one of your boards in Trello and go to “Email-to-board Settings” ind the settings section of the sidebar. Emails sent to this address will appear as a task in this board. The subject of the email will become the title and the body will become the description.

2. Add your Trello email address to Note To Self Mail

Add this email address to Note To Self Mail. You can also set the label to “Trello” or any other descriptive name.

Note To Self Mail > Settings > Add email …

3. Adjust the subject

Trello uses the subject as a main source of a new note. Set the subject to “Use first line of note”. This ensures, that the first line is used as subject and all the other text lines are moved to the description of the task.

Note To Self Mail > Settings > Add email … > Subject

Usage

There are some shortcuts or special chars that can be used in the subject of the mail. All available features are described in Trello’s documentation: Formatting Tips (opens in a new tab)”>Creating cards by email > Formatting Tips.

Now, you can send any note to Trello. With the following text …

… a new task will be created in Trello …

You might notice, that the task was placed in the correct list (as set in Trello) and was tagged with “home”. All the other contents of the input (line 2 up to the end) are moved to the task description. That’s it!

You want to support this app?

Note to Self Mail - The fastest app to send your ideas into your inbox. | Product Hunt

Note To Self: how to quickly create tasks in OmniFocus

If you are using the email capture / mail drop feature of OmniFocus, you can speed up the notes with Note To Self Mail. The app creates notes in OmniFocus in seconds.

Setup Note To Self Mail for OmniFocus

1. Create your OmniFocus email address

If you’re already using the Omni Sync Server to sync OmniFocus, you can log in to the sync server web interface and create your first Mail Drop address. After logging in, just click the Create Address button to automatically generate the email address (a combination of your account name and a random string of characters, for example).

2. Add your OmniFocus email address to Note To Self Mail

Add this email address to Note To Self Mail. You can also set the label to “OmniFocus” or any other descriptive name.

Note To Self Mail > Settings > Add email …

3. Adjust the subject

OmniFocus uses the subject as a main source of a new note. Set the subject to “Use first line of note”. This ensures, that the first line is used as subject and all the other text lines are moved to the body.

Note To Self Mail > Settings > Add email … > Subject

Usage

In OmniFocus, the subject line of that message becomes the name of the new Inbox item. The body of the message becomes the Note, which can contain text, attachments (such as images and files), and simple HTML (more complex formatting is removed). All available features are described in OmniFocus documentation: Capture Methods > Email Capture (Mail Drop).

Now, you can send any note to OmniFocus. With the following text …

… a new task will be created in your Inbox.

You might notice, that the first line is used as title. All the other contents of the input (line 2 up to the end) are moved to the task description. That’s it!

You want to support this app?

Note to Self Mail - The fastest app to send your ideas into your inbox. | Product Hunt