Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-19510] Add Ti.App.iOS.UserActivity.isSupported()

GitHub Issuen/a
TypeImprovement
PriorityNone
StatusClosed
ResolutionFixed
Resolution Date2015-10-08T20:42:51.000+0000
Affected Version/sRelease 5.1.0
Fix Version/sn/a
ComponentsiOS
Labelsn/a
ReporterFokke Zandbergen
AssigneeAngel Petkov
Created2015-09-14T15:08:31.000+0000
Updated2017-03-16T22:49:27.000+0000

Description

Ti.App.iOS.UserActivity has an (undocumented: TIDOC-2306) supported property but no isSupported() method. I'd expect such a method since the tightly related [Ti.App.iOS.SearchableIndex.isSupported](http://docs.appcelerator.com/platform/latest/#!/api/Titanium.App.iOS.SearchableIndex-method-isSupported) also exists, just like [Ti.WatchSession.isSupported](http://docs.appcelerator.com/platform/latest/#!/api/Titanium.WatchSession-property-isSupported) by the way.

Comments

  1. Angel Petkov 2015-10-05

    Hello , the UserActivity class has a isSupported() method technically.Its actually just .supported, so for example
       var test =  Ti.App.iOS.createUserActivity({
       activityType: 'com.setdirection.home',
           title: 'activity 1',
           userInfo: {
               msg: 'hello world'
           }
       });
       
       if(!test.supported){
           alert('activity is not supported');
       }
       
       if(test.supported){
           alert('activity is supported');
       }
       
    In this case it should return false as the com.setdirection.home is not a valid activityType
  2. Fokke Zandbergen 2015-10-05

    Uh, yes.. so the ticket is about adding the isSupported() method. I know the property is there.
  3. Angel Petkov 2015-10-05

    Sorry i didn't explain that very well my bad. The .supported is a method which returns the property.
  4. Fokke Zandbergen 2015-10-06

    You mean I can do:
       if (!test.supported()) {
         //
       }
       
    Still, my point is not to have a method but to have one that is on par with Ti.App.iOS.SearchableIndex.isSupported() and Ti.WatchSession.isSupported().
  5. Angel Petkov 2015-10-06

    Yeah you could , well actually it's getSupported() but writing .supported calls the same method. The isSupported methods in the other classes essentially do exactly the same thing as this method. Except that the userActivity one has a couple more checks than just if its Xcode 7 and iOS 9.
  6. Fokke Zandbergen 2015-10-06

    OK, so is it a documentation thing or do we need a code change to support Ti.App.iOS.UserActivity.isSupported() ?
  7. Angel Petkov 2015-10-06

    You can't call isSupported as no method is named that but using the getSupported() or just supported() will do the same thing . Could change the docs and code from getSupported to isSupported , but all that would do is just rename the method thats it.
  8. Fokke Zandbergen 2015-10-07

    Yes,so that's all that this request is about; adding/renaming the method so we have parity with the other 2 mentioned and developers have a better (think less, do more) experience.
  9. Angel Petkov 2015-10-07

    :PR: https://github.com/appcelerator/titanium_mobile/pull/7283
  10. Hans Knöchel 2015-10-08

    PR *approved*!
  11. Angel Petkov 2015-10-08

    Thank's!
  12. Lee Morris 2017-03-16

    Closing ticket as fixed.

JSON Source