0 Replies Latest reply on Oct 18, 2017 2:31 AM by MariusAD

    iOS app started failing on task

    MariusAD

      So I need to clarify something about my problem. I have an app in development and have it sent to test flight, and it runs perfectly as it should on all the devices.

      Then I was going to add some extra stuff into the app that has nothing to do with this function, its just buttons and forgot "password". Then when I wanted to test my app first on my Android device, I got errors. I guess it might have something todo with that I installed React Native the week before, maybe something with the gradle or something. Could not fix the problem, so I tested with starting a new project and it worked fine. So I just copied the files over and installed the plugins, and it works just fine in Android but iOS the function "fails". I then downgraded all the plugins to the same version same for the cordova-ios version, but still the same problem.

       

      The Problem:

      I have a app for recording and when the user is recording a sound should play in loop in the background. I solved this by using AVAudioSession, and nothing in this function has changed at all. But when I start recording the beat in the back plays one time, then timer stops for a bit and starts again stops and starts. So its trying to do the processes but it freezes for half a second or so, and the Amplitude stops working.

       

      Example code:

      AVAudioSession.setCategoryWithOptions(

      AVAudioSession.Categories.PLAY_AND_RECORD,

      AVAudioSession.CategoryOptions.MIX_WITH_OTHERS,

      function() {

         console.log('audio session success');

      },function() {

         console.log('audio session error');

      });

      var beat = new Audio("audio/snap-11.wav");

      recordButton.addEventListener("touchstart", function(){

         if(!isRecording){

            intBeat = setInterval(function(){

               beat.play();

            }, (60 / bpm) * 1000);

            mediaRec = new Media(filename, app.services.audio.success, app.services.audio.error);

            mediaRec.startRecord();

         } else {

            clearInterval(intBeat);

            mediaRec.stopRecord();

         }

      }, false);

       

       

      Can it be something with ios-deploy or something like that builder etc.? Because I didn't use that beforehand, and I'm using OnsenUI as framework but that version is also the same as the old project.