All Projects → chrisgriffith → Ionic Native Mocks

chrisgriffith / Ionic Native Mocks

Ionic Native Mocks are designed to be used as placeholders during development for the actual Ionic Native modules.

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to Ionic Native Mocks

cordova-plugin-today-widget
Add a today widget app extension target to your cordova project.
Stars: ✭ 51 (-75.36%)
Mutual labels:  ionic, cordova-plugin
Cordova Plugin Nativestorage
Cordova plugin: Native storage of variables in Android, iOS and Windows
Stars: ✭ 285 (+37.68%)
Mutual labels:  cordova-plugin, ionic
ionic-native-sms-retriever-plugin-master
Cross-platform plugin for Cordova / PhoneGap to Retrieve SMS. Available for Android.
Stars: ✭ 16 (-92.27%)
Mutual labels:  ionic, cordova-plugin
example-cordova-code-push-plugin
Ionic + Cordova Code Push Plugin Example
Stars: ✭ 45 (-78.26%)
Mutual labels:  ionic, cordova-plugin
Google Login With Ionic Framework
Ionic example app of how to add Google Plus authentication into an Ionic Framework app. Add google login to your ionic app!
Stars: ✭ 24 (-88.41%)
Mutual labels:  cordova-plugin, ionic
cordova-plugin-flurryanalytics
Adds support for all that Flurry Analytics flavored goodness to your Cordova based apps
Stars: ✭ 23 (-88.89%)
Mutual labels:  ionic, cordova-plugin
ionic-signature-pad
Ionic plugin to input singnature pad
Stars: ✭ 15 (-92.75%)
Mutual labels:  ionic, cordova-plugin
scanbot-sdk-example-ionic
Scanbot scanner SDK example app for Ionic with Cordova.
Stars: ✭ 24 (-88.41%)
Mutual labels:  ionic, cordova-plugin
Ionic Native
Native features for mobile apps built with Cordova/PhoneGap and open web technologies. Complete with TypeScript support.
Stars: ✭ 2,129 (+928.5%)
Mutual labels:  ionic, cordova-plugin
Cordova Admob Pro
🔥 Cordova Plugin for Google AdMob, DFP, ADX. Easy monetization using mobile Ad, with single line of JavaScript. Compatible with Cordova CLI, Inoic, PhoneGap Build, etc.
Stars: ✭ 690 (+233.33%)
Mutual labels:  cordova-plugin, ionic
ionic-hockeyapp
Need HockeyApp in your Ionic application, add this package!
Stars: ✭ 19 (-90.82%)
Mutual labels:  ionic, cordova-plugin
Unityionicintegration
A guide to integrating Unity 3D content into an Ionic app and sending messages between them (for Android & iOS)(tested with Vuforia plugin)
Stars: ✭ 94 (-54.59%)
Mutual labels:  cordova-plugin, ionic
cordova-plugin-android-window-background
Simple Cordova plugin to set Android window background on start-up 🎨 🍭
Stars: ✭ 15 (-92.75%)
Mutual labels:  ionic, cordova-plugin
cordova-plugin-apkupdater
This plugin allows your Android app to download and install compressed updates without the Google Play Store.
Stars: ✭ 46 (-77.78%)
Mutual labels:  ionic, cordova-plugin
Cordova Plugin Fingerprint Aio
👆 📱 Cordova Plugin for fingerprint sensors (and FaceID) with Android and iOS support
Stars: ✭ 236 (+14.01%)
Mutual labels:  cordova-plugin, ionic
Cordova Plugin App Update
App updater for Cordova/PhoneGap
Stars: ✭ 290 (+40.1%)
Mutual labels:  cordova-plugin, ionic
Ionic4
This repo contains example code for ionic4. Get Step by Step tutorial of this repo examples using https://ampersandacademy.com/tutorials/ionic-framework-4
Stars: ✭ 37 (-82.13%)
Mutual labels:  cordova-plugin, ionic
Awesome Ionic
😎 A curated list of amazingly awesome Ionic libraries, resources and solutions.
Stars: ✭ 1,340 (+547.34%)
Mutual labels:  cordova-plugin, ionic
Ionic Cli
The Ionic command-line interface
Stars: ✭ 1,967 (+850.24%)
Mutual labels:  ionic
Mobile Challenges
📝 A Huge List of Challenges for Mobile Developers 📱 | For now only in pt-BR
Stars: ✭ 186 (-10.14%)
Mutual labels:  ionic

Ionic Native Mocks

Ionic Native Mocks are designed to be used as placeholders during development for the actual Ionic Native modules. Ionic Native is a curated set of wrappers for Apache Cordova plugins that make adding any native functionality you need to your Ionic mobile application easier.

Ionic Native wraps plugin callbacks in a Promise or Observable, providing a common interface for all plugins and making it easy to use plugins with Angular change detection.

However, once you integrate these plugins into your Ionic application, use of a device or emulator is required for development and testing which can slow your workflow.

Installation

This project allows developers to use Ionic Native Mocks in place of the actual Ionic Native modules. They can be installed in via to methods.

  1. via npm: Installing these prebuilt mocks is easy but they are not easily customized.
  2. via GitHub and manually added to your Ionic project: Installing this way means the mocks can be customized to return specific data, like a specific parsing of a QR code.

Installation via npm

Run following command to install a Ionic Native Mock into your project.

npm install @ionic-native-mocks/[plug-in] --save

For instance, to install the camera mock:

npm install @ionic-native-mocks/camera --save

You also need to install the Ionic Native package for each plugin you want to add. Please see the Ionic Native documentation for complete instructions on how to add and use the plugins.

Documentation

For the full Ionic Native documentation, please visit https://ionicframework.com/docs/native/.

Basic Usage

To use a plugin, import and add the plugin provider to your @NgModule, and then inject it where you wish to use it.

// app.module.ts
import { Camera } from '@ionic-native/camera';
import { CameraMock } from '@ionic-native-mocks/camera';
...

@NgModule({
  ...

  providers: [
    ...
    { provide: Camera, useClass: CameraMock }
    ...
  ]
  ...
})
export class AppModule { }
import { Platform } from 'ionic-angular';
import { Camera, CameraOptions } from '@ionic-native/camera';

@Component({ ... })
export class MyComponent {

  constructor(private camera: Camera, private platform: Platform) {

    platform.ready().then(() => {

      const options: CameraOptions = {
        quality: 100,
        destinationType: this.camera.DestinationType.DATA_URL,
        encodingType: this.camera.EncodingType.JPEG,
        mediaType: this.camera.MediaType.PICTURE
      }

      this.camera.getPicture(options).then((imageData) => {
        // imageData is either a base64 encoded string or a file URI
        // If it's base64:
        console.log(imageData);
        let base64Image = 'data:image/jpeg;base64,' + imageData;
      }, (err) => {
        // Handle error
      });
    });
  }
}

Customization

To learn how to customize an Ionic Native Mock, see the guide at: https://chrisgriffith.wordpress.com/2017/08/21/customizing-ionic-native-mocks/ (https://chrisgriffith.wordpress.com/2017/08/21/customizing-ionic-native-mocks/)

Missing a mock? Found a problem?

Let us know or submit a PR!

Credits

Chris Griffith - @chrisgriffith

Leif Wells - @leifwells

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].