agamemnus / cordova-plugin-xapkreader

Easily access Google Play APK expansion file data.
32 stars 55 forks source link

Issue when load image from OBB folder with dynamic image name. #118

Closed bhavika162 closed 5 years ago

bhavika162 commented 6 years ago

Hello,

I am using OBB folder to load image with dymaic name, but image doesn't display after creating build. I had display the image name with full path, it's showing me with proper name. e.g. image path :

When I print the image path, it's showing fine but It is not displaying image.

FYI, I am using cordova-plugin-xapkreader v6.5.0.

Please let me know if anyone has worked on this issue. Thanks in advance.

agamemnus commented 6 years ago

What is a "dynamic name"???

What is the path that you used? ... needs more details.

bhavika162 commented 6 years ago

So if I keep static image path like this img src="content://com.app.myapp/assets/img_john.png" I am able to get image from zip/obb.

But if I try to get image like this img src="content://com.app.myapp/assets/img_{{ this.config.userName }}.png" I am not getting image.

agamemnus commented 6 years ago

That is a bug on your end... I'm pretty sure, anyway.. Try console logging what strings you send.

On Feb 19, 2018 8:46 AM, "bhavika162" notifications@github.com wrote:

So if I keep static image path like this

I am able to get image from zip/obb.

But if I try to get image like this

I am not getting image.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/agamemnus/cordova-plugin-xapkreader/issues/118#issuecomment-366697418, or mute the thread https://github.com/notifications/unsubscribe-auth/ADFJWAGin_iyduBm2vYc5-tYGVv-Kcfwks5tWXtBgaJpZM4SKTtp .

lolaswift commented 5 years ago

Hello,

I am using OBB folder to load image with dymaic name, but image doesn't display after creating build. I had display the image name with full path, it's showing me with proper name. e.g. image path :

When I print the image path, it's showing fine but It is not displaying image.

FYI, I am using cordova-plugin-xapkreader v6.5.0.

Please let me know if anyone has worked on this issue. Thanks in advance.

have you found any solution?

lolaswift commented 5 years ago

@bhavika162 Have you found any solution?

agamemnus commented 5 years ago

This doesn't have anything to do with the plugin though. The plugin doesn't just somehow read the HTML file and determine if something is generated in Javascript or not.

lolaswift commented 5 years ago

All right. Here is the solution if you use ionic 3:

  1. .ts import { DomSanitizer } from '@angular/platform-browser'; constructor( public _sanitizer: DomSanitizer, }
  2. .html <img [src]="_sanitizer.bypassSecurityTrustResourceUrl(images[i])" />

@agamemnus Thank you for this great plugin. Thank you for your contribution to the open source world. You're a great man! This repo deserves more stars! --Cheers,Lola

agamemnus commented 5 years ago

Thanks. Happy you found the solution! 👍