# Ionic3: InAppBrowser cannot be injected in Service provider (only iOS)

**URL:** <https://forum.ionicframework.com/t/ionic3-inappbrowser-cannot-be-injected-in-service-provider-only-ios/163880>\
**Category:** Ionic Native\
**Created:** [May 14, 2019, 3:42pm UTC](https://forum.ionicframework.com/t/ionic3-inappbrowser-cannot-be-injected-in-service-provider-only-ios/163880 "2019-05-14T15:42:24Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![msign](https://avatars.discourse-cdn.com/v4/letter/m/a88e57/32.png) [@msign](https://forum.ionicframework.com/u/msign)\
**Post date:** [May 14, 2019, 3:42pm UTC](https://forum.ionicframework.com/t/ionic3-inappbrowser-cannot-be-injected-in-service-provider-only-ios/163880/1 "2019-05-14T15:42:24Z")

</div>

Hi,

I ran into this problem with the InAppBrowser Plugin (@ionic-native/in-app-browser) after I tried to refactor a feature of my app. I extracted a part of the functionality of a page to a service provider.

In Android everything still works fine, but iOS execution is stopped right after the splash screen is shown with following error:

> “ReferenceError: Can’t find variable: InAppBrowser”

(line number pointing to the constructor arguments of my new service provider)

constructor of my service provider

```auto
constructor(
        private localizationService: ILocalizationService,
        private basketService: IBasketService,
        private iab: InAppBrowser,
        private platform: Platform,
        private injector: Injector
    ) {}

```

app.module.ts  
providers:[  
…

```auto
 {
      provide: 'ICheckoutService',
      useClass: CheckoutService,
      deps: ['ILocalizationService', 'IBasketService', InAppBrowser, Platform, Injector]
    }
]

```

Before I had the 3 constructor arguments injected in a Page/Component, where it worked perfectly fine…  
I know I could go back to the last version of the code, but that component was seriously cluttered, a refactoring had to be done.

I have absolutely no clue what’s wrong and where it may fail and I would be very appreciative of any pointers or hints.

I already tried removing/reinstalling the plugin, same with the ios platform… even deleted the node\_modules and reinstalled all npm packages which did nothing 😕

Thanks in advance!
