Details

    • Type: Bug
    • Status: Open
    • Priority: Medium
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: Release 10.1.0
    • Component/s: None
    • Labels:
      None

      Description

      We have a large number of APIs that take callbacks as arguments. Many can be modified to return a Promise. A few have been modified as part of the initial PR landing native Promise support.

      Landed:

      • Titanium.Android.requestPermissions
      • Titanium.Calendar.requestCalendarPermissions
      • Titanium.Contacts.requestContactsPermissions
      • Titanium.Database.DB.executeAsync
      • Titanium.Database.DB.executeAllAsync
      • Titanium.Filesystem.requestStoragePermissions
      • Titanium.Geolocation.getCurrentHeading
      • Titanium.Geolocation.getCurrentPosition
      • Titanium.Geolocation.requestLocationPermissions
      • Titanium.Geolocation.requestTemporaryFullAccuracyAuthorization
      • Titanium.Geolocation.forwardGeocoder
      • Titanium.Geolocation.reverseGeocoder
      • Titanium.Media.requestAudioRecorderPermissions
      • Titanium.Media.requestCameraPermissions
      • Titanium.Media.requestPhotoGalleryPermissions

      TODO:

      • Titanium.UI.View.animate
      • Titanium.Android.Activity.startActivityForResult
      • Titanium.App.iOS.SearchableIndex.addToDefaultSearchableIndex
      • Titanium.App.iOS.SearchableIndex.deleteAllSearchableItems
      • Titanium.App.iOS.SearchableIndex.deleteAllSearchableItemByDomainIdenifiers
      • Titanium.App.iOS.SearchableIndex.deleteSearchableItemsByIdentifiers
      • Titanium.App.iOS.UserNotificationCenter.getPendingNotifications
      • Titanium.App.iOS.UserNotificationCenter.getDeliveredNotifications
      • Titanium.App.iOS.UserNotificationCenter.requestUserNotificationSettings
      • Titanium.Calendar.requestEventsAuthorization
      • Titanium.Contacts.requestAuthorization
      • Titanium.Media.Android.scanMediaFiles
      • Titanium.Media.requestMusicLibraryPermissions
      • Titanium.Media.requestCameraAccess
      • Titanium.Media.takeScreenshot
      • Titanium.Media.requestAuthorization
      • Titanium.Media.requestAudioPermissions
      • Titanium.Media.VideoPlayer.requestThumbnailImagesAtTimes
      • Titanium.Network.BonjourService.publish
      • Titanium.Network.BonjourService.resolve
      • Titanium.Network.BonjourService.stop
      • Titanium.Platform.openURL
      • Titanium.UI.WebView.takeSnapshot
      • Titanium.UI.WebView.createPDF
      • Titanium.UI.WebView.createWebArchive
      • Titanium.UI.WebView.findString

      Some return non-void types if the callback is omitted, however, so migrating them may prove to be more difficult.

      Async APIs that return values if callback is not supplied:

      • Titanium.UI.View.toImage
      • Titanium.UI.WebView.evalJS

      Additionally some APIs do not take a callback but occur async, return void, and could be made to return a Promise to that they are await-able. See TIMOB-27710 (i.e. Window.open())

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                cwilliams Christopher Williams
                Reporter:
                cwilliams Christopher Williams
              • Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:

                  Backbone Issue Sync

                  • Backbone Issue Sync is enabled for your project, but we do not have any synchronization info for this issue.

                    Git Integration