[iOS] Refactored the creation process of ams extension, moved the initialization code to pluginInitialize method.

1. Refactored the creation process of ams extension, moved the
initialization code to pluginInitialize method
2. Removed the warnings.