Slide Show dont display

  • 1
  • Problem
  • Updated 4 years ago
hey,
In my app the slideshow don't appear when i compile my android app using build.phonegap.com and i am sure that my code is correct because i was use before phonegap so far how i would fix it

Regards yours
Photo of Amany El

Amany El

  • 12 Posts
  • 0 Reply Likes

Posted 4 years ago

  • 1
Photo of Petra V.

Petra V., Champion

  • 7794 Posts
  • 1391 Reply Likes
My crystal bowl is apparently not calibrated properly.

What slideshow? Where are the images coming from? How do you whitelist? Do you get any javascript errors? What have you changed since the last time it worked correctly? How can you be sure your code is still correct, while the environment (OS, PGB) has changed?
Photo of Amany El

Amany El

  • 12 Posts
  • 0 Reply Likes
I have a slide show in my app to display an image the image are selected from database and i don't have any java script error in plus i just change the plugin for push notification before i use the pushwoosh and now the push Notification
Photo of Petra V.

Petra V., Champion

  • 7794 Posts
  • 1391 Reply Likes
In which of your test devices does the slide show 'not work'? Please mention OS and version. In which test devices does it still work?

Which PGB version are you using now? Which version as it still worked?
Photo of Amany El

Amany El

  • 12 Posts
  • 0 Reply Likes
i test on android 5.0.2 and dont work in any android device I use the PGB 3.5.0
Photo of Petra V.

Petra V., Champion

  • 7794 Posts
  • 1391 Reply Likes
With PGB3.5.0, you are currently 7(!) versions behind. Google Play will not accept such apps anymore (starting next week).
You need to upgrade to at least PGB cli-5.2.0 (or rather a later version), first. Only then you should see how to get your slideshow working again.
Photo of Amany El

Amany El

  • 12 Posts
  • 0 Reply Likes
okay thank you I will try if it will work but the version of PGB may affect my code somehow ?? or not
Photo of Petra V.

Petra V., Champion

  • 7794 Posts
  • 1391 Reply Likes
C'mon! Such question was asked only yesterday, and is currently still on the first forum page.
Photo of Amany El

Amany El

  • 12 Posts
  • 0 Reply Likes
okay Thank you
Photo of Amany El

Amany El

  • 12 Posts
  • 0 Reply Likes
i connected my slide show to databse using this method :
which selcet my image that have the field feater on and it select right :
$query_all_location = "SELECT DISTINCT markers_id, markers_name, markers_logo, markers_address FROM markers where featured = 'on'";

$rec_set_all_location = mysqli_query($localhost, $query_all_location) or die("Err ".$localhost->error);
while($row_all_location = mysqli_fetch_assoc($rec_set_all_location)){
$data[] = array(
'markers_id' => $row_all_location['markers_id'],
'markers_name' => $row_all_location['markers_name'],
'markers_logo' => $row_all_location['markers_logo'],
'markers_address' => $row_all_location['markers_address']
);
};
echo json_encode($data);

//end

and i link my app to this php file and this function :
function loadHomePageSlider(pw) {
console.log("## FUNCTION: loadHomePageSlider - BEGIN");
$("#mySwipe .swipe-wrap").empty();

var url ='my site url which goes to the previous function ';

if (offlineMode === "false") {
getRequest(url, function (data) {
var data = JSON.parse(data.responseText);
for (var i = 0; i < data.length; i++) {
console.log("##### SLIDER IMAGE #" + i);
var logo = data[i]['markers_logo'];
if (logo === "null" || logo == null || logo === "undefined") {
logo = "img/logo-web.png";
}
$("#mySwipe .swipe-wrap").append('');
$("#mySwipe .swipe-wrap").append('');
}
var elem = document.getElementById('mySwipe');
window.mySwipe = Swipe(elem, {
auto: 3000,
paginate: true,
continuous: true,
stopPropagation: true
});
});
}
console.log("## FUNCTION: loadHomePageSlider - END");
}

so far waht is wrong whis this fuctions because m,y slideshow still dont appera i work on phonegap build 3.5.0 and test on an android phone
Photo of Petra V.

Petra V., Champion

  • 7794 Posts
  • 1391 Reply Likes
Your code is partly invisible, because you failed to wrap it in a CODE element as described under "some HTML allowed".

Anyway, which of the console.log() are displayed? Where does your code fail?
Photo of Amany El

Amany El

  • 12 Posts
  • 0 Reply Likes
both are displayed and regarding the code it doesn't fail just when i create the apk the slide don't appear at all just a white space
Photo of Petra V.

Petra V., Champion

  • 7794 Posts
  • 1391 Reply Likes
1. Of these conditions, the first and third will never be true, because the logo variable will not contain such string:
if (logo === "null" || logo == null || logo === "undefined") {

2. You said: both are displayed.
There are three log() statements, of which the second is an iteration. Unfortunately, nowhere you display or log the server response, so you're not even checking if that server response is what you expected.

3. Your html code as appended for each slide doesn't appear, so I can't see whether or not the included html is correct.

4. I can't see how you whitelist the images included in the swiper. Since you're building with the ancient PGB3.5.0, a wildcard access rule should be sufficient (but not for later PGB versions)
I also can't see whether or not you included a CSP
Photo of Amany El

Amany El

  • 12 Posts
  • 0 Reply Likes
1- i don't include any CSP
2- and for the html code :
<div id="home_page_slider" class="slider">

<div id='mySwipe' style='margin:0 auto' class='swipe' data-snap-ignore="true">
<div class='swipe-wrap'>

</div>
</div>

</div>
Photo of Petra V.

Petra V., Champion

  • 7794 Posts
  • 1391 Reply Likes
*sigh*
That is not Your html code as appended for each slide
Photo of JesseMonroy650 (Volunteer)

JesseMonroy650 (Volunteer), Champion

  • 3325 Posts
  • 122 Reply Likes
@Petra,
Wait, I have the weegie board out. It says, "High winds until noon today."... Sorry, it appears unrelated to this. :-(

Jesse
Photo of JesseMonroy650 (Volunteer)

JesseMonroy650 (Volunteer), Champion

  • 3325 Posts
  • 122 Reply Likes
@Amany,
Since this is your first post, please answer the following question.
- Is this your first hybrid App?
- Are you using the Phonegap Desktop App?
- Are you using CLI, SDK or Build? Please do not assume the answer, please read the link.

thanks
Jesse
Photo of Amany El

Amany El

  • 12 Posts
  • 0 Reply Likes
hi
-yes its the first
-currently i use the build but i also test it with desktop app but the same result
best regards.
Photo of JesseMonroy650 (Volunteer)

JesseMonroy650 (Volunteer), Champion

  • 3325 Posts
  • 122 Reply Likes
You cannot use Phonegap Build with Desktop App.
Have your tried your code with a mobile webbrowser.
Photo of Amany El

Amany El

  • 12 Posts
  • 0 Reply Likes
no i try it with both desktop app and phone build and in both don't work in plus i tried with the mobile web browser and the same issue
Photo of JesseMonroy650 (Volunteer)

JesseMonroy650 (Volunteer), Champion

  • 3325 Posts
  • 122 Reply Likes
Okay. What you are doing is not support _or_ no loner support.
Jesse