Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all 49526 articles
Browse latest View live

Same Code But Different Views in IOS & Android

$
0
0

@piashsarker wrote:

Bottom Buttons are not wieght as expected in Android Device.

Code :

<ion-card>

    <img src="assets/imgs/logo.png"/>

    <ion-card-content>
      <ion-card-title>
        Nine Inch Nails Live
      </ion-card-title>
      <p>
        The most popular industrial group ever, and largely responsible for bringing the music to a mass audience.
      </p>
    </ion-card-content>

    <ion-row no-padding>
      <ion-col>
        <button ion-button clear small color="danger" icon-start>
          <ion-icon name='star'></ion-icon>
          Favorite
        </button>
      </ion-col>
      <ion-col text-center>
        <button ion-button clear small color="danger" icon-start>
          <ion-icon name='musical-notes'></ion-icon>
          Listen
        </button>
      </ion-col>
      <ion-col text-right>
        <button ion-button clear small color="danger" icon-start>
          <ion-icon name='share-alt'></ion-icon>
          Share
        </button>
      </ion-col>
    </ion-row>

  </ion-card>

Posts: 2

Participants: 2

Read full topic


How can my ionic cordova app get shared url or file location from other apps on the same device

$
0
0

@felixsun wrote:

I’ve got a question about my ionic cordova app recently. I’m trying to get a shared file location or an online file url from other apps on the device and upload the file to my backend storage. The uploading function is working well and I can upload videos and photos. But I have difficulty to get the file from other app, how can I do that? Which plugin should I use to do that? Thank you guys!

Posts: 2

Participants: 2

Read full topic

Permanent offline data

$
0
0

@jackkiu158 wrote:

I am currently developing an app that help students to practice past exam questions for a matriculation exam. The catch here is to beat other apps already doing this by making questions and solutions of the app totally available offline.

My challenge now is the data is large. About #12,000 questions/solutions approximately. Where do I put this data?

Posts: 4

Participants: 4

Read full topic

Select dropdown issue on ios 11

$
0
0

@OKulich wrote:

Hello everybody,

I have to maintain one project that I didn’t develop. As it was said said to me, it was develloped with Ionic framework.
Although, when i see the project structure it doesn’t seems to be an ionic project. Because i tried to build a new project (v1) and structures of these 2 projects (new one v1 & project which I’ve to deal with) are not the same.

So i don’t know if it’s really an Ionic project, or there’re juste some libraries which are used by app…
I’ve never developped with Ionic before.
However, when I see index.php and templates it seems to use Ionic elements…

Also, there is Ionic package into “lib” folder…
As you can see it uses a 1.3.1 version, which is causing the bug with a dropdown on iOS 11 (it doesn’t select ethe element). What is the main reason I write here :slightly_smiling_face:.

After some time passed surfing on the internet i found that it’s a quite common issue on iOS11. Because iOS11 is using WKWebView, and actual version of Ionic (in my project) uses UIWebView…

search

So my question is how to deal with this issue? Can i just download an other library? Or I have to complie something?

Any help would be grateful.
Thanks.

Posts: 1

Participants: 1

Read full topic

Virtual Scroll + Segments or Search

$
0
0

@philipdring wrote:

Hi,

I noticed that when I add VirtualScroll to two lists which are in different segments, it breaks as soon as I change segment. Here is the code:


<div [ngSwitch]="profile">

    <ion-list [virtualScroll]="pItems" *ngSwitchCase="'profile_1'">
        <button ion-item *virtualItem="let pItem" (click)="goToP(pItem)">{{pItem.company}}</button>
    </ion-list>

    <ion-list [virtualScroll]="mItems" *ngSwitchCase="'profile_2'">
        <button ion-item *virtualItem="let mItem" (click)="goToN(mItem)">{{mItem.company}}</button>
    </ion-list>

</div>

It’s a shame because I have noticed significant performance improvements in non-segmented tests.

In addition to this, the searchbar disappears completely.

Previous code for a segment with search (works well):

<ion-list *ngSwitchCase="'profile_1'">
    <ion-searchbar (ionInput)="filterP($event)" placeholder="Search"></ion-searchbar>
    <button ion-item *ngFor="let pItem of pItems; let i=index" (click)="goToP(pItem)">{{pItem.company}}</button>
</ion-list>

Attempt to use search with VirtualScroll and without segments:

<ion-list [virtualScroll]="pItems">
    <ion-searchbar (ionInput)="filterP($event)" placeholder="Search"></ion-searchbar>
    <button ion-item *virtualItem="let pItem" (click)="goToP(pItem)">{{pItem.raison_sociale}}</button>
</ion-list>

Would anyone have any ideas?

Posts: 1

Participants: 1

Read full topic

(keydown) event is not working in device

$
0
0

@guptajagadish843 wrote:

<ion-input type=“text” [(ngModel)]=“ulblevel.society"name=“society” placeholder=“Society Name*” (keydown.space)=”$event.preventDefault()" (keydown)=“keyPressed($event)”>

keyPressed($event)
 {
   console.log($event);
   if($event.key!=" ")
   {
     if($event.key=="Backspace")
     {
        this.sname = this.sname.slice(0,-1);
     }
     else
     this.sname += $event.key;
   }
 }

The above code is working fine in browser but not in device

Posts: 1

Participants: 1

Read full topic

After upgarding ionic Ads not showing

$
0
0

@rashnk wrote:

While working on a ionic project, i run npm install -g ionic@latest ,after that the app stopped showing ads, im using admob-free plugin in my app, now it is showing a black blank space at banner ads position, it was showing ads untill i upgrade ionic

Posts: 2

Participants: 1

Read full topic

Image not showing on device

$
0
0

@fdak wrote:

Hello,

this is my code

<img id="airlinesLogo" src= "{{ 'assets/images/airlines/' +
                itinerary.inbound.flights[0].marketing_airline +'.png' }}"/>

It works well on the browser. but no image on the device.
What do i do wrong? can someone help?

(i already searched the forum for answers)

Thx

Posts: 3

Participants: 2

Read full topic


Upload image/video file to server using filetransfer

$
0
0

@chiragebiztrait wrote:

Hello,
i am having problem in uploading image/video to server using php apis.

Ionic side code:

    this.params.u_id = this.user.u_id;
    this.params.country = this.user.country;
    this.params.ad_type = this.adType;
const fileTransfer: FileTransferObject = this.transfer.create();
    const options: CameraOptions = {
      quality: 100,
      mediaType: this.adType - 1,
      sourceType: this.camera.PictureSourceType.PHOTOLIBRARY,
      targetWidth: 250,
      targetHeight: 250,
    };
    this.platform.ready().then((readySource) => {
      console.log(options.mediaType);
      this.camera.getPicture(options).then((imageData) => {
        // this.loaderProvider.show();

        if (this.adType == 1) {
          this.params.path = imageData;
          this.params.thumbnail_image = imageData;
        } else {
          this.params.path = imageData;
          this.params.thumbnail_image = 'assets/icon/video-player.png';
        }
        let options1: FileUploadOptions = {
          params: this.params,
          chunkedMode: false,
          fileKey: 'file',
          mimeType: "multipart/form-data"
        }
        console.log(imageData);
        var upload = fileTransfer.upload(imageData, encodeURI(this.globals.SERVER_URL + 'addMarketingAd'), options1).then((data) => {
          console.log("success: ", data);
          // IN CONSOLE message "please upload video or image"
          this.loaderProvider.hide();
          const toast = this.toast.create({
            message: "Ad successfully uploaded",
            duration: 3000,
            position: 'bottom'
          });
          toast.present();
        }, (err) => {
          // fileTransfer.abort();
          console.log("Cannot upload image");
          this.loaderProvider.hide();
          const toast = this.toast.create({
            message: "Cannot upload this image",
            duration: 3000,
            position: 'bottom'
          });
          toast.present();
        });
      }, (err) => {
        console.log("image upload :", err);
      });
    }).catch(err => {
      console.log("device is not ready");
    });

PHP side Code

public function actionaddMarketingAd(){

    $wb = new Webservice();
    $fields = $_REQUEST;
    // Set parameters
    if (isset($fields['u_id']) && $fields['u_id'] != '' && isset($fields['country']) && $fields['country'] != '' && isset($fields['user_type']) && $fields['user_type'] != '' && isset($fields['ad_type']) && $fields['ad_type'] != '' && isset($fields['ad_category']) && $fields['ad_category'] != '' ) {


        // images / video upload
        if(isset($_FILES["path"]))
        {

                    $uploadedFile=$_FILES["path"]["name"];
                    $filename=explode(".", $uploadedFile);
                    $fileext = $filename[count($filename) - 1];
                    $file_name = time(). '.'.$fileext;
                    move_uploaded_file($_FILES["path"]["tmp_name"],$this->markrtingPath .$file_name);


                    if(isset($_FILES["thumbnail_image"]))
                    {
                        $thumbnail_uploadedFile=$_FILES["thumbnail_image"]["name"];
                        $thumbnail_filename=explode(".", $thumbnail_uploadedFile);
                        $thumbnail_fileext = $thumbnail_filename[count($thumbnail_filename) - 1];
                        $thumbnail_name = time(). '1.'.$thumbnail_fileext;
                        move_uploaded_file($_FILES["thumbnail_image"]["tmp_name"],$this->markrtingPath .$thumbnail_name);

                    }
                    else
                    {
                        $thumbnail_name = "";
                    }


                    $table = 'marketing_ads';// Pass table name
                    $columns = array(
                                    'u_id' => $fields['u_id'],
                                    'country_id' => $fields['country'],
                                    'ur_id' => $fields['user_type'],
                                    'ad_type' => $fields['ad_type'],
                                    'path' => $file_name,
                                    'thumbnail_image' => $thumbnail_name,
                                    'ad_category_id' => $fields['ad_category'],
                                    'inserted_date' => date('Y-m-d H:i:s'),
                                    'expire_date' => date('Y-m-d H:i:s', strtotime('+1 day', strtotime(date('Y-m-d h:i:s')))),
                                   );
                    $response = $wb->addData($table,$columns);
                    $ad_id = $response['lastid'];
                    if($response['status'] == '1')
                    {

                        //process for payment
                        $user_query = "SELECT * FROM user_master WHERE u_id = ".$fields['u_id'];
                        $user_detail = $wb->getRowDetail($user_query);
                        //faturah payment gateway

                        $name = $user_detail['fullname'];
                        $email = $user_detail['email'];
                        $mobile = $user_detail['mobile'];
                        $service_name = 'Advertisement';

                        $post_string = '<?xml version="1.0" encoding="utf-8"?>
                        <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
                          <soap:Body>
                            <PaymentRequest xmlns="http://tempuri.org/">
                              <req>
                                <CustomerDC>
                                  <Name>'.$name.'</Name>
                                  <Email>'.$email.'</Email>
                                  <Mobile>'.$mobile.'</Mobile>
                                  <Gender>string</Gender>
                                  <DOB>string</DOB>
                                  <civil_id>string</civil_id>
                                  <Area>string</Area>
                                  <Block>string</Block>
                                  <Street>string</Street>
                                  <Avenue>string</Avenue>
                                  <Building>string</Building>
                                  <Floor>string</Floor>
                                  <Apartment>string</Apartment>
                                </CustomerDC>
                                <MerchantDC>
                                  <merchant_code>00000000</merchant_code>
                                  <merchant_username>testapi@myfatoorah.com</merchant_username>
                                  <merchant_password>XXXXX</merchant_password>
                                  <merchant_ReferenceID>00000</merchant_ReferenceID>
                                  <ReturnURL>http://solutiontrackers.com/dev-a/zerototwo/demo.php?success</ReturnURL>
                                  <merchant_error_url>http://solutiontrackers.com/dev-a/zerototwo/demo.php?error</merchant_error_url>
                                </MerchantDC>
                                <lstProductDC>
                                  <ProductDC>
                                  <product_name>'.$service_name.'</product_name>
                                  <unitPrice>'.$fields['amount'].'</unitPrice>
                                  <qty>1</qty>
                                  </ProductDC>
                                </lstProductDC>
                                <totalDC>
                                  <subtotal>'.$fields['amount'].'</subtotal>
                                </totalDC>
                                <paymentModeDC>
                                  <paymentMode>BOTH</paymentMode>
                                </paymentModeDC>
                                <paymentCurrencyDC>
                                  <paymentCurrrency>KWD</paymentCurrrency>
                                </paymentCurrencyDC>
                              </req>
                            </PaymentRequest>
                          </soap:Body>
                        </soap:Envelope>';

                        $url = 'https://test.myfatoorah.com/pg/PayGatewayServiceV2.asmx';
                        $user = '';
                        $password = '';
                        $soap_do = curl_init();
                        curl_setopt($soap_do, CURLOPT_URL,$url );
                        curl_setopt($soap_do, CURLOPT_CONNECTTIMEOUT, 10);
                        curl_setopt($soap_do, CURLOPT_TIMEOUT, 10);
                        curl_setopt($soap_do, CURLOPT_RETURNTRANSFER, true );
                        curl_setopt($soap_do, CURLOPT_SSL_VERIFYPEER, false);
                        curl_setopt($soap_do, CURLOPT_SSL_VERIFYHOST, false);
                        curl_setopt($soap_do, CURLOPT_POST, true );
                        curl_setopt($soap_do, CURLOPT_POSTFIELDS, $post_string);
                        curl_setopt($soap_do, CURLOPT_HTTPHEADER, array('Content-Type: text/xml; charset=utf-8', 'Content-Length:
                        '.strlen($post_string) ));
                        curl_setopt($soap_do, CURLOPT_USERPWD, $user . ":" . $password);
                        curl_setopt($soap_do, CURLOPT_HTTPHEADER, array(
                        'Content-type: text/xml'
                        ));
                        $result = curl_exec($soap_do);

                        $err = curl_error($soap_do);
                        // print_r($result);

                        $soap = simplexml_load_string($result);
                        $soap->registerXPathNamespace('ns1', 'http://tempuri.org/');
                        $test = (string) $soap->xpath('//ns1:PaymentRequestResponse/ns1:PaymentRequestResult/ns1:paymentURL[1]')[0];

                        $response = array('status'=>true, 'data' => array('message' => 'ad uploaded successfully', 'ad_id' => $ad_id, 'url' => $test));
                    }
                    else
                    {
                        $response = array('status'=>false, 'data' => array('message' => 'something wents wrong'));
                    }
        }
        else
        {
            $response = array('status'=>false, 'data' => array('message' => 'Please upload Video or Image'));
        }

    }
    else
    {
        $response = array('status'=>false, 'data' => array('message' => 'some data is missing'));
    }
    header('Content-type: application/json');
    echo json_encode($response);
    die;
}

Help me. i am stuck in this problem from 10-15 days.

Posts: 1

Participants: 1

Read full topic

Touch ID not working

$
0
0

@inoxious wrote:

I am trying to test the TouchID plugin: https://ionicframework.com/docs/native/touch-id/
But it simply does not show up on my app. I am checking it on a real device, not in emulator, all the integration is done as required ( added TouchID in app module in providers, etc.etc.) I even checked some boilerplates from github, but it still does not show up on my iphone7. I have tried mixing with https://ionicframework.com/docs/native/keychain-touch-id/ but the two plugins does not work together.

Posts: 1

Participants: 1

Read full topic

Loading bar

$
0
0

@mdline wrote:

Hello,

I show a loading bar during the get-Request.
Is it possible to show bubbles or dots as follows:

    let loader = this.loadingCtrl.create({name: 'bubbles '});
    loader.present();

But this does not work for me, it always shows circles.

Posts: 1

Participants: 1

Read full topic

Ionic send notifications method FCM

$
0
0

@EnzoDLP wrote:

Hello, I am currently trying to make the notifications work on my application but I can not do it … I have advanced a lot, so I use FCM, I get to receive the notifications by sending them a from firebase but as I try to make a method to sent a notification from the application it does not work … I do not know where it came from … I leave you the code of the method below

Thank you in advance

    envoieNotif(){
  let headers = new Headers({ 'Authorization': 'key=ID', 'Content-Type': 'application/json' });
  let options = new RequestOptions({ headers: headers });
  let notification = {
    "notification": {
      "title": "test",
      "body": "Blabla",
      "click_action": "FCM_PLUGIN_ACTIVITY",
      "sound": "default"
    }, "data": {
      //OPTIONAL PARAMS
    },
    "to": "TOKEN",
    "priority": "high"
  }
  let url = 'https://fcm.googleapis.com/fcm/send';
  this.http.post(url, notification, options)
}

Posts: 1

Participants: 1

Read full topic

Ionic2 virtualscroll failing to render properly on scroll (video)

$
0
0

@millerf wrote:

Hi,

In the previous ionic version I had a some problems with the virtual scroll (items being rendered overlapping and taking forever to render properly).

Since the last update it is getting even worse, where scrolling would make the virtualscroll not rendering properly.

Here is a screen cap:
https://youtu.be/tfYSLy6p-y0

Here is a snippet of my code. All property are properly filled and the height and with of the mzk-thumb is locked in CSS.

                    <ion-content (ionScroll)="onScroll($event);"
                                 [hidden]="!(!timedout && !loading && medias.length!==0)"
                    >

                        <ion-list [virtualScroll]="medias"
                                  [approxItemHeight]="iconHeight+ 'px'"
                                  [approxItemWidth]="iconWidth + 'px'">
                            <div *virtualItem="let item">
                                <mzk-thumb
                                    [media]="item">
                                </mzk-thumb>
                            </div>
                        </ion-list>
                    </ion-content>

the “medias” object isn’t modified after being set either…

Posts: 1

Participants: 1

Read full topic

PayPal Donate With Ionic

$
0
0

@junjunhernandez wrote:

Hi. I am developing a Progressive Web App using Ionic. Native PayPal Mobile SDK does not work with a web app. How can I achieve the PayPal integration, donate specifically with Ionic as PWA? I have tried different approach like HTML forms for PayPal (and those that I previously used in previous projects) but they does not seem to work here. Any idea? TIA.

Posts: 1

Participants: 1

Read full topic

Ion img dynamic

$
0
0

@mdline wrote:

Hello,

I have something like this, but does not work.

    <ion-item *ngFor="let card of cards">
      <ion-img item-left [src]="{{card.type == 'MARRY' ? 'assets/Marry.mpng' : 'assets/Default.png'}}"></ion-img>
    </ion-item>

Posts: 2

Participants: 2

Read full topic


Access control allow origin

Not to dismiss the radio alert box when clicking outside of it?

I created app in ionic with apis using wamp server i used to run on device its running but not authenticating to serve e can any one help me

iOS - Policy related to Geolocation Modal Message

$
0
0

@Vitorcmaia wrote:

Hello, everyone.

I’m trying to publish an app for iOS. I’m already in the last step of the process at iTunes Connect, but the app was rejected due to “Guideline 5.1.1 - Legal - Privacy - Data Collection and Storage”, which indicates that I did not specify why do I need the user’s location.

The problem claims that I “do not clarify the use of this feature in the permission modal alert.”, but the indicated modal is not ionic’s, it is from the system, as shown below.

image

I’ve found that I can describe the use of the geolocation plugin in the instalation with GEOLOCATION_USAGE_DESCRIPTION parameter: https://ionicframework.com/docs/native/geolocation/

But it was not enough to make iTunes Connect accept my app, it seems the modal was rejected because of the message itself. I couldn’t find a way to change the message.

May someone help me with this matter?

Thanks in advance!

Posts: 1

Participants: 1

Read full topic

Camera in Web Browser / Android

$
0
0

@mk0547 wrote:

I’m trying to use the Camera, and I would like to know if any example on how to make it work on both web / native.

I have checked ionic native camera Its works fine on ios and andriod but in Web browser their is no capture button

Posts: 1

Participants: 1

Read full topic

Viewing all 49526 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>