Merge pull request #179 from jndrm/develop

Fix Runtime Issues:
This commit is contained in:
chrisgarrity 2018-09-26 09:28:27 -04:00 committed by GitHub
commit 85a68eb017
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 6 deletions

View file

@ -280,12 +280,14 @@ NSMutableDictionary *soundtimers;
}
+ (void)soundEnded:(NSTimer*)timer {
NSString *soundName = [[timer userInfo] objectForKey:@"soundName"];
if (sounds[soundName] == nil) return;
NSString *callback = [NSString stringWithFormat:@"iOS.soundDone('%@');", soundName];
UIWebView *webview = [ViewController webview];
NSString *soundName = [[timer userInfo] objectForKey:@"soundName"];
if (sounds[soundName] == nil) return;
NSString *callback = [NSString stringWithFormat:@"iOS.soundDone('%@');", soundName];
UIWebView *webview = [ViewController webview];
dispatch_async(dispatch_get_main_queue(), ^{
[webview stringByEvaluatingJavaScriptFromString:callback];
}
});
}
+ (NSString *)stopSound :(NSString*)name {
AVAudioPlayer *snd = sounds[name];

View file

@ -19,7 +19,9 @@ NSString *oncomplete;
+ (NSString *) hideSplash :(NSString *)body{
UIImageView* splashScreen = [ViewController splashScreen];
[splashScreen removeFromSuperview];
dispatch_async(dispatch_get_main_queue(), ^{
[splashScreen removeFromSuperview];
});
return @"1";
}