Add #if for iOS in resource::init