Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IOS crash after permission left on Ionic 3 #110

Open
texano00 opened this issue May 15, 2018 · 0 comments
Open

IOS crash after permission left on Ionic 3 #110

texano00 opened this issue May 15, 2018 · 0 comments

Comments

@texano00
Copy link

texano00 commented May 15, 2018

Expected Behaviour

After permission left on IOS it wouldn't crash.

Actual Behaviour

After permission left on IOS, the plugin crash with com.apple.coreaudio.avfaudio', reason: 'required condition is false: nullptr == Tap()'. Then, if i restart the app (permission already left) it works.

Reproduce Scenario (including but not limited to)

Platform and Version (eg. Android 5.0 or iOS 9.2.1)

iOS 11.3

Cordova CLI version and cordova platform version

ionic info


    @ionic/cli-plugin-proxy : 1.5.8
    @ionic/cli-utils        : 1.19.2
    ionic (Ionic CLI)       : 3.20.0

global packages:

    cordova (Cordova CLI) : 8.0.0 

local packages:

    @ionic/app-scripts : 3.1.8
    Cordova Platforms  : android 7.1.0
    Ionic Framework    : ionic-angular 3.9.2

System:

    Android SDK Tools : 26.1.1
    Node              : v8.11.1
    npm               : 6.0.1 
    OS                : Linux 4.13

Sample Code that illustrates the problem

import { Platform } from 'ionic-angular';

declare const SpeechRecognition: any;

@Injectable()
export class HomeService {
  isRecording: boolean = false;
  recognition: any;

  constructor(public platform: Platform) {
    this.platform.ready().then(() => {
      this.recognition = new SpeechRecognition();
      this.recognition.continuous = true;
      this.recognition.interimResults = false;
      this.recognition.lang = 'it-IT';
    });
  }

  startListening() {
    if (!this.isRecording) {
      this.isRecording = true;
      this.recognition.start();
    }
  }

  stopListening() {
    return new Promise((resolve, reject) => {
      const that = this;
      this.recognition.onresult = function(event) {
        if (event.results[0][0].transcript !== undefined) {
          const string = event.results[0][0].transcript;

          if (typeof string === 'string') {
            console.log(string);
            resolve(string);
          }
        }
      };
      this.recognition.stop();
      that.isRecording = false;
    });
  }
}

In my code on press of a button i call startListening() then after release the stopListening() method.

Logs taken while reproducing problem

com.apple.coreaudio.avfaudio', reason: 'required condition is false: nullptr == Tap()'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant