Thanks for reporting this. The method call is no longer required as of R2 2018 due to the fix for the following issue (still required for previous versions though), so you can remove it from the code:
The documentation has already been updated with this information (step 5 section 3):
The warning message has been modified to include the above note and will be available in future releases (internal builds, service packs, etc.). The app templates will also be updated, so that the warning is not displayed.