sunnycupertino / cordova-plugin-admob-simple

Cordova plugin allowing Admob interstitials and banner ads.
MIT License
164 stars 150 forks source link

Add an interstitial before open .pdf file #30

Closed lilici77 closed 5 years ago

lilici77 commented 6 years ago

Hi! I tried to add an interstitial before open .pdf file. After I close the (interstitital) button I want to appear .pdf file.

Here is my code:

.... else{ initAd(); showInterstitialFunc(); window.resolveLocalFileSystemURL(cordova.file.applicationDirectory + 'www/assets/'+fisier+'.pdf' , function(fileEntry) { window.resolveLocalFileSystemURL(cordova.file.externalDataDirectory, function(dirEntry) { fileEntry.copyTo(dirEntry, 'file.pdf', function(newFileEntry) { cordova.plugins.fileOpener2.open(newFileEntry.nativeURL,'application/pdf', { error : function(e) { alert('Error status: ' + e.status + ' - Error message: ' + e.message); }, success : function () {

                            }
                        }
                        );
                    });
                });
            });
            }
sunnycupertino commented 6 years ago

You can use the onDismissInterstitialAd event to see when it it closed, then open the pdf.