Javascript validation error

10 posts, 0 answers
  1. Roman
    Roman avatar
    27 posts
    Member since:
    Sep 2013

    Posted 13 Oct 2014 Link to this post

    The code analysis of the AppBuilder Windows client shows "Javascript: Unexpected" errors for the following assignment:

    options = options || {};

    Unfortunately it's inside the official Cordova Admob plugin code, so I don't intend to change it.
  2. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 16 Oct 2014 Link to this post

    Hi Roman,

    I was not able to reproduce such errors and I also wasn't able to find a similar code snippet in the AdMob plugin code. Are you using the Telerik Verified AdMob plugin or a different one. Can you provide us with a sample project reproducing the errors or a list of steps to prepare one on our side. Also, please post the exact errors you are seeing. Having that information will allow us to try and replicate the issue locally so that we can further investigate it.

    Regards,
    Tina Stancheva
    Telerik
     

    Visit the Telerik Verified Plugins Marketplace and get the custom Cordova plugin you need, already tweaked to work seamlessly with AppBuilder.

     
  3. Roman
    Roman avatar
    27 posts
    Member since:
    Sep 2013

    Posted 21 Oct 2014 in reply to Tina Stancheva Link to this post

    Hi Tina,

    thanks for your Reply.

    No, weed didn't use the Telerik verified Plugin, since it has 2 major issues, which are not present in the admob-google-cordova plugin. So we have been using this instead. We would be happy to use the Telerik plugin if these issues would be addressed. I have posted these a while ago in another thread. Basically it's:

    1. If you start the app on a tablet in landscape orientation, the ads are displayed in the wrong size in landscape and are not displayed at all if you rotate to portrait

    2. On some of our test devices, the plugin causes extremely high cpu load

    But I'm getting carried away. This thread was actually about the JS validation error of Telerik AppBuilder. It's caused by this line of the formentioned Cordova plugin:

    options = options || admob.DEFAULT_OPTIONS;

    You can see it here in context on line 78.

    Regards,
    Roman
  4. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 24 Oct 2014 Link to this post

    Hello Roman,

    Thank you for getting back to us and please accept my apology for the delay in the response. I managed to reproduce the issue and the code analysis throws an error as it doesn recognize the space character. It seems that the space used in the file is a non-breaking space and we will make sure to update our code analysis to properly recognize it in future. However, even without these errors the version of the plugin you mentioned cannot build for Android in AppBuilder on our side. I was therefore wondering if you have tried the version under this repository - it seems to be more popular and we have had previous quires about it. We have therefore tested it in AppBuilder and we can confirm that it works.

    As for the Telerik Verified AdMob plugin issues, would you mind elaborating a bit more on both. We tried to reproduce the device orientation issues but to no avail and we would appreciate it if you can describe on what devices you reproduce it. Also, please let us know if you can reproduce the issue with the sample AdMob application. This information (the devices type, OS and a project reproducing the issue), will help us also investigate the performance issues.

    If you can post the details here or in the AdMob repository, we will further investigate the case.

    Regards,
    Tina Stancheva
    Telerik
     

    Visit the Telerik Verified Plugins Marketplace and get the custom Cordova plugin you need, already tweaked to work seamlessly with AppBuilder.

     
  5. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 24 Oct 2014 Link to this post

    Hi Roman,

    I just wanted to follow up on this and let you know that we found the issue with the Android build of the AdMob plugin you are using. It is caused by the settings in the plugin.xml file and specifically by this setting:
    <config-file target="res/values/strings.xml" parent="">
      <string name="banid">ca-app-pub-8440343014846849/3119840614</string>
      <string name="intid">ca-app-pub-8440343014846849/4596573817</string>
    </config-file>
    The parent should not be an empty string and if you modify it like this:
    <config-file target="res/values/strings.xml" parent="/*">
      <string name="banid">ca-app-pub-8440343014846849/3119840614</string>
      <string name="intid">ca-app-pub-8440343014846849/4596573817</string>
    </config-file>
    you should be able to build the project for iOS and Android platforms.

    Regards,
    Tina Stancheva
    Telerik
     

    Visit the Telerik Verified Plugins Marketplace and get the custom Cordova plugin you need, already tweaked to work seamlessly with AppBuilder.

     
  6. Roman
    Roman avatar
    27 posts
    Member since:
    Sep 2013

    Posted 24 Oct 2014 Link to this post

    Thank you very much for your replies, Tina!

    Good to know what caused the issue. We will have that in mind when integrating other plugins.

    As for the Admob plugin, we have switched to the Telerik verfied Admob plugin for now. It has a better Javascript API for controlling the ad display and seems more solid to us. It has a few drawbacks compared to other Admob plugins, but we will accept them for now (e.g. no interstitial support, issues when rotating).

    I will investigate the issues with rotating on monday and get back to you here.

    Thanks,
    Roman
  7. Roman
    Roman avatar
    27 posts
    Member since:
    Sep 2013

    Posted 30 Oct 2014 Link to this post

    I tried to reproduce the error with the Admob sample app, but I couldn't get it working there. No ads show up in the demo, no matter what I try. I know it's basically working, because it runs in our own apps. But in the demo app, no ads show up.

    I'll try this next week with another simple app I'll build, but right now I don't have the time to debug the demo app.
  8. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 04 Nov 2014 Link to this post

    Hi Roman,

    I still cannot replicate any issues in the sample app utilizing the AdMob plugin. I tested it behavior on the following devices:
    • iPhone 5S running iOS 8.1
    • iPhone 5C running iOS 7.1.2
    • iPad running iOS 7.0.4
    • Nexus 4 running Android 4.3

    The plugins works as expected. In any case, if you manage to find any time to go back and see what causes issues on your side, please update this thread and we will gladly further investigate.

    Regards,
    Tina Stancheva
    Telerik
     

    Visit the Telerik Verified Plugins Marketplace and get the custom Cordova plugin you need, already tweaked to work seamlessly with AppBuilder.

     
  9. Roman
    Roman avatar
    27 posts
    Member since:
    Sep 2013

    Posted 04 Nov 2014 in reply to Tina Stancheva Link to this post

    First of all, I can't get the Telerik admob sample app to display any ad at all. I'm currently testing on a Nexus 4 as well (Android 4.4.4 tho).

    Could you describe, what changes you perform to the downloaded demo app? I imported it into AppBuilder and tried using our own admob keys as well as testing ads (true/false) in any combination. Unfortunately without any success.
  10. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 07 Nov 2014 Link to this post

    Hi Roman,

    I haven't changed anything really, apart from the AdMob keys. I attached my app for reference. I am not sure why it doesn't work on your side as it seems we are both following the same steps.

    In any case, please try the attached sample on your side. I tested it on a few different Android devices on my side and it works as expected on all of them. But again, please make sure there are no restrictions coming from the network connection on the device.

    Regards,
    Tina Stancheva
    Telerik
     

    Visit the Telerik Verified Plugins Marketplace and get the custom Cordova plugin you need, already tweaked to work seamlessly with AppBuilder.

     
Back to Top