Quantcast
Channel: Ionic Forum - Latest topics
Viewing all 71027 articles
Browse latest View live

Ionic 3 cordova-plugin-facebook4 - There was an error making the graph call. (iOS Only | Android Working)

$
0
0

@rockfordbuzz wrote:

Using this plugin inside my Ionic 3 project… https://github.com/jeduan/cordova-plugin-facebook4

I’ve done my research and have followed the syntax steps in other issues that I’ve found online. However, I still continue to experience the same problem.

My API call is working in Android Studio, but gives me the generic error, “There was an error making the graph call”, in iOS. In Android, it posts to the proper business page just fine. iOS is the only place giving me the error.

Here is my Ionic Info…

cli packages: (/Users/jacobbradt/Documents/Version 3.0/Mobile App/node_modules)

@ionic/cli-utils  : 1.19.2
ionic (Ionic CLI) : 3.20.0

global packages:

cordova (Cordova CLI) : 7.0.1 

local packages:

@ionic/app-scripts : 3.0.1
Cordova Platforms  : android 6.2.3 ios 4.4.0
Ionic Framework    : ionic-angular 3.7.1

System:

ios-deploy : 1.9.1 
ios-sim    : 6.0.0 
Node       : v6.11.1
npm        : 3.10.10 
OS         : macOS High Sierra
Xcode      : Xcode 9.4.1 Build version 9F2000 

Below is my function for making the API call using the plugin. Any help would be appreciated. Please note that I’m making an API call to access a Business Page and not a User Account.

this.fb.api(this.requestData.facebook_id + "/?fields=access_token",["manage_pages","publish_pages"])
              .then(res => {
                let access_token = res.access_token;

                let facebookString = this.requestData.facebook_id + "/feed/?fields=id" + "&method=post" + "&link=" + link
                if(this.post.facebook_message != null && this.post.facebook_message != ""){
                  facebookString += "&message=" + this.post.facebook_message;
                }
                facebookString += "&access_token=" + access_token;

                this.fb.api(facebookString,["manage_pages","publish_pages"])
                  .then(res => {
                    this.loading.dismissAll();
                    this.viewCtrl.dismiss('update');
                    let toast = this.toastCtrl.create({
                      message: 'Your Post Was Shared to Facebook!',
                      duration: 3000,
                      position: 'top'
                    });
                    toast.present();
                  })
                  .catch(e => {
                    this.loading.dismissAll();
                    this.viewCtrl.dismiss('update');
                    let toast = this.toastCtrl.create({
                      message: 'Error Sharing Your Post to Facebook',
                      duration: 3000,
                      position: 'top'
                    });
                    toast.present();
                  });
              })
              .catch(e => {
                console.log(e);
              });

Thanks in advance for all your help!

Posts: 1

Participants: 1

Read full topic


Need of Suggestion for storing data in cloud

$
0
0

@Clenton wrote:

Hi all, I want to develop an app in that admin uploads pdf files or content to the app and other users can view and read it. For this which cloud service is good for storing files and data

Posts: 2

Participants: 2

Read full topic

Ionic 2 - refresh view without making another service call

$
0
0

@zamorisima wrote:

I’m still novice with Ionic and Angular so please bear with me –

I have a search field in which a user can enter the name of an item or start to type, a list of items with radio buttons appear to select and see related images populate below in the body upon selection. When a radio button is selected, the items are pushed to an array.

  <ion-navbar>
    <ion-searchbar [(ngModel)]="search" (ionInput)="getItems($event)"></ion-searchbar> 
**This ion-list element displays the items to be selected**
      <ion-list id="thingsList">
    <ion-item *ngFor="let item of items">
      <ion-label>{{ item.text }}</ion-label>
      <ion-checkbox id='things' (ionChange)="addToFavs(item)" color="success"></ion-checkbox>
    </ion-item>
  </ion-list>
**This ion-list below shows selected items that can be removed by clicking on trash icon**
  <ion-list>
      <ion-item *ngFor="let item of service.itemDisplay">
        {{ item.text }}
        <ion-icon ios="ios-trash" (click)="trashItem(item)"></ion-icon>
      </ion-item>
   </ion-list>
  </ion-navbar>
...

   <ion-list>
   <ion-row *ngFor="let post of feedService.feed"</ion-row>
</ion-list>

Here is my simplified typescript to run a function in the service provider to remove items:

trashItem() {
    this.service.toggleFavorite(obj); 
}

The associated images with any item are loaded via an API.

MY QUESTION:
After removing any item from the selected array, how can I refresh the page view to remove the associated content WITHOUT making another api call on init?

Thank you.

Posts: 1

Participants: 1

Read full topic

Leafletjs help

Show "No result" during search . How it can avoid?

$
0
0

@anespa wrote:

Friends,

I tried to search for two fields and show the result on same page , but during search “No result” message can see in background. All data come fine from provider.

My template is

my template is like

<ion-content padding>
    <h4 style="color:#F00" *ngIf="!connectivityFlag">You are offline, please be online to know building status </h4>
    <form [formGroup]="formgroup" >    
        <ion-item>
            <ion-label stacked>Inward No</ion-label>
            <ion-input type="text" formControlName="inwardno" [(ngModel)]="data.inwardno" [disabled]="!connectivityFlag" ></ion-input>
        </ion-item>
        <ion-item>
            <ion-label stacked>Year</ion-label>
            <ion-input type="text" formControlName="year" [(ngModel)]="data.year" [disabled]="!connectivityFlag" ></ion-input>
        </ion-item>
        <button  ion-button block round [disabled]="!inwardno.valid||!year.valid" (click)="getFileStatus()">Search</button>

    </form>  

    <div style="text-align:center" *ngIf="searchFlag && !dataFlag">
        <br /><br />
        <b>No search results , please try again</b>
    </div>
   	<br/>
	<br/>
	<div class="box-header" *ngIf="searchFlag && dataFlag">                 
	                                        <div class="box-header">
	                                           <h3 class="box-title">File Status Details</h3>
                                            </div>
											<div class="box-body no-padding">
                                                <table class="table table-striped"> 
                                                    <tbody>
                                                        
                                                        <tr> 
                                                            <td>Date Received</td>
                                                            <td>{{Date}}</td>
                                                        </tr>
                                                        <tr> 
                                                            <td>Inward No</td>
                                                            <td>{{FileNo}}</td>
                                                        </tr>
														<tr> 
                                                            <td>Local Body Name <br/> </td>
                                                            <td>{{lbname}}</td>
                                                        </tr>
                                                        <tr> 
                                                            <td>Address</td>
                                                            <td>{{ApplicantAddress}}</td>
                                                        </tr> 
                                                        <tr> 
                                                            <td>Locality</td>
                                                            <td>{{ApplicantLocality}}</td>
                                                        </tr> 
                                                                     
                                                        <tr> 
                                                            <td>File Status</td>
                                                            <td>{{FileStatus}}</td>
                                                        </tr> 
														<tr> 
                                                            <td>Seat</td>
                                                            <td>{{seat}}</td>
                                                        </tr> 
														<tr> 
                                                            <td>File ID</td>
                                                            <td>{{FileID}}</td>
                                                        </tr> 
                                                                                                                                                   

My contrller function is

getFileStatus ()
  {
    //alert(this.data.efileno);
    var inwardno = this.data.inwardno;
    var year = this.data.year;
    var lbid = this.lb;
    //alert("lbid:"+lbid+"yr:"+year+"inwno:"+inwardno);
    //this.dataFlag = false;
    this.searchFlag = true;
    if(this.global1.getnetwork()) 
    {
      let loader = this.loadingController.create({
        content: "Loading Result ... "
      });  
      loader.present(); 
      this.statusProvider.getFileStatus(lbid,inwardno,year)
      .then(data => {
       //alert(JSON.stringify(data));

        if(data) 
        {
          //alert("inside IF");
          this.dataFlag = true;
          this.LBID =  data[0].intLBID;
          this.ApplicantAddress = data[0].Address;
          this.ApplicantLocality = data[0].Locality;
          this.Date = data[0].dtDateofReceipt;
          this.FileStatus = data[0].StatusEng;
          this.FileID = data[0].intFileID;
          this.seat = data[0].chvSeat;
          this.FileNo = data[0].chvFileNo;
          loader.dismiss();
        } else {
          this.dataFlag = false;
          this.searchFlag = true;
          loader.dismiss();
        } 
        loader.dismiss();
      });
      loader.dismiss();
      this.dataFlag = false;
      this.searchFlag = true;
    } else {
      //alert("You are offline, please be online to know building permit status");
      this.presentAlert();
    }

  }

Please help how it can make proper

Thanks

Posts: 1

Participants: 1

Read full topic

Deploying Ionic app on azure

$
0
0

@kshah87 wrote:

Hello everyone,
I want to deploy my ionic app on microsoft azure but I am not able to run command “npm install -g ionic”, it gives me an error "Bad Request:.
Please provide your views.

Posts: 1

Participants: 1

Read full topic

Fab misalignment when using the Mobile's large or xl text

Ionic debug keeps showing me same error

$
0
0

@binghco wrote:

Hi,

I update ionic to latest one, but unfortunately not same as before, well i’m not expert on ionic but i’m getting a lot of error not as ionic 2 it is smooth and stable on ubntu.
Even when i change the code or remove the error it is keeping showing same error, i restart the pc but keep showing same error, i’m thinking it is problem with cashe maybe in browser or in ionic framework, how to clear cash on the page?!

Posts: 1

Participants: 1

Read full topic


Ionic 3 display html pages

$
0
0

@Planeur wrote:

Hi, I’m on a project and I don’t find an answer to my question :
I just want to display google with an ionic application and the user can do a search and go to another site. He has to stay in the application and the application will not launch Firefox or Safari.
Thanks in advance,

Posts: 1

Participants: 1

Read full topic

Ionic 1 admob free plugin

$
0
0

@ayushsingla991 wrote:

Hey Everyone.
I am new to ionic and working on an already built project. I am using Admob Free plugin to show ads. But the problem is, whenever I try to edit anything (e.g. worked on onesignal push notification) this plugin breaks and stop showing any ads.
Now it’s not showing the banner and interstitial ad on app load. But it’s loading the ad as I can see in the android studio logcat. When I click on a button to show interstitial ad, it works.
All the things were working before the edit. And there was not a major change in onesignal too. just added a variable to check if the notification was clicked or not.

TIA.

Posts: 1

Participants: 1

Read full topic

How to change, edit ringtone on the phone

$
0
0

@luisfonsi wrote:

Hi everybody.
Are you having problems like me, not cutting music, editing music, etc. I need your help. Thanks very much

Posts: 1

Participants: 1

Read full topic

No virtual devices found - Ionic Cordova Emulate iOS

$
0
0

@0AlexScott wrote:

I am trying to emulate my Ionic app in iOS but when I run ionic cordova emulate ios I get an error:

No target specified for emulator. Deploying to undefined simulator
Device type "com.apple.CoreSimulator.SimDeviceType.undefined" could not be found.

It seems that even though there are emulators available on my OSX, Ionic can’t access them for some reason. Why are there no devices found in Ionic when there are clearly devices that can be run elsewhere? Could this be an issue with env vars?

For reference: ionic info:

cli packages: (/usr/local/lib/node_modules)

    @ionic/cli-utils  : 1.19.2
    ionic (Ionic CLI) : 3.20.0

global packages:

    cordova (Cordova CLI) : 7.0.1

local packages:

    @ionic/app-scripts : 3.1.10
    Cordova Platforms  : android 6.2.3 ios 4.4.0
    Ionic Framework    : ionic-angular 3.9.2

System:

    ios-sim : 7.0.0
    Node    : v9.1.0
    npm     : 6.0.0
    OS      : macOS High Sierra
    Xcode   : Xcode 9.4.1 Build version 9F2000

Environment Variables:

    ANDROID_HOME : not set

Misc:

    backend : pro

When I run ionic cordova emulate ios --list I get the following output:

Available ios virtual devices:

However, when I run ios-sim showdevicetypes I get:

    Apple-Watch-38mm, watchOS 4.3
    Apple-Watch-42mm, watchOS 4.3
    Apple-Watch-Series-2-38mm, watchOS 4.3
    Apple-Watch-Series-2-42mm, watchOS 4.3
    Apple-Watch-Series-3-38mm, watchOS 4.3
    Apple-Watch-Series-3-42mm, watchOS 4.3
    iPhone-5s, 11.4
    iPhone-6, 11.4
    iPhone-6-Plus, 11.4
    iPhone-6s, 11.4
    iPhone-6s-Plus, 11.4
    iPhone-7, 11.4
    iPhone-7-Plus, 11.4
    iPhone-8, 11.4
    iPhone-8-Plus, 11.4
    iPhone-SE, 11.4
    iPhone-X, 11.4
    iPad-Air, 11.4
    iPad-Air-2, 11.4
    iPad--5th-generation-, 11.4
    iPad-Pro--9-7-inch-, 11.4
    iPad-Pro, 11.4
    iPad-Pro--12-9-inch---2nd-generation-, 11.4
    iPad-Pro--10-5-inch-, 11.4
    Apple-TV-1080p, tvOS 11.4
    Apple-TV-4K-4K, tvOS 11.4
    Apple-TV-4K-1080p, tvOS 11.4

And running xcrun simctl list gives:

    == Device Types ==
    iPhone 4s (com.apple.CoreSimulator.SimDeviceType.iPhone-4s)
    iPhone 5 (com.apple.CoreSimulator.SimDeviceType.iPhone-5)
    iPhone 5s (com.apple.CoreSimulator.SimDeviceType.iPhone-5s)
    iPhone 6 (com.apple.CoreSimulator.SimDeviceType.iPhone-6)
    iPhone 6 Plus (com.apple.CoreSimulator.SimDeviceType.iPhone-6-Plus)
    iPhone 6s (com.apple.CoreSimulator.SimDeviceType.iPhone-6s)
    iPhone 6s Plus (com.apple.CoreSimulator.SimDeviceType.iPhone-6s-Plus)
    iPhone 7 (com.apple.CoreSimulator.SimDeviceType.iPhone-7)
    iPhone 7 Plus (com.apple.CoreSimulator.SimDeviceType.iPhone-7-Plus)
    iPhone 8 (com.apple.CoreSimulator.SimDeviceType.iPhone-8)
    iPhone 8 Plus (com.apple.CoreSimulator.SimDeviceType.iPhone-8-Plus)
    iPhone SE (com.apple.CoreSimulator.SimDeviceType.iPhone-SE)
    iPhone X (com.apple.CoreSimulator.SimDeviceType.iPhone-X)
    iPad 2 (com.apple.CoreSimulator.SimDeviceType.iPad-2)
    iPad Retina (com.apple.CoreSimulator.SimDeviceType.iPad-Retina)
    iPad Air (com.apple.CoreSimulator.SimDeviceType.iPad-Air)
    iPad Air 2 (com.apple.CoreSimulator.SimDeviceType.iPad-Air-2)
    iPad (5th generation) (com.apple.CoreSimulator.SimDeviceType.iPad--5th-generation-)
    iPad Pro (9.7-inch) (com.apple.CoreSimulator.SimDeviceType.iPad-Pro--9-7-inch-)
    iPad Pro (12.9-inch) (com.apple.CoreSimulator.SimDeviceType.iPad-Pro)
    iPad Pro (12.9-inch) (2nd generation) (com.apple.CoreSimulator.SimDeviceType.iPad-Pro--12-9-inch---2nd-generation-)
    iPad Pro (10.5-inch) (com.apple.CoreSimulator.SimDeviceType.iPad-Pro--10-5-inch-)
    iPad (6th generation) (com.apple.CoreSimulator.SimDeviceType.iPad--6th-generation-)
    Apple TV (com.apple.CoreSimulator.SimDeviceType.Apple-TV-1080p)
    Apple TV 4K (com.apple.CoreSimulator.SimDeviceType.Apple-TV-4K-4K)
    Apple TV 4K (at 1080p) (com.apple.CoreSimulator.SimDeviceType.Apple-TV-4K-1080p)
    Apple Watch - 38mm (com.apple.CoreSimulator.SimDeviceType.Apple-Watch-38mm)
    Apple Watch - 42mm (com.apple.CoreSimulator.SimDeviceType.Apple-Watch-42mm)
    Apple Watch Series 2 - 38mm (com.apple.CoreSimulator.SimDeviceType.Apple-Watch-Series-2-38mm)
    Apple Watch Series 2 - 42mm (com.apple.CoreSimulator.SimDeviceType.Apple-Watch-Series-2-42mm)
    Apple Watch Series 3 - 38mm (com.apple.CoreSimulator.SimDeviceType.Apple-Watch-Series-3-38mm)
    Apple Watch Series 3 - 42mm (com.apple.CoreSimulator.SimDeviceType.Apple-Watch-Series-3-42mm)
    == Runtimes ==
    iOS 11.4 (11.4 - 15F79) - com.apple.CoreSimulator.SimRuntime.iOS-11-4
    tvOS 11.4 (11.4 - 15L576) - com.apple.CoreSimulator.SimRuntime.tvOS-11-4
    watchOS 4.3 (4.3 - 15T212) - com.apple.CoreSimulator.SimRuntime.watchOS-4-3
    == Devices ==
    -- iOS 11.4 --
        iPhone 5s (68553C20-B109-4807-B20C-E93006B8F214) (Shutdown)
        iPhone 6 (9B230488-BC8B-4947-AC2B-3B8245878625) (Shutdown)
        iPhone 6 Plus (028C9FB4-4179-4772-AC96-9AEC9F447859) (Shutdown)
        iPhone 6s (BFBFF883-1207-4049-851B-DDFF15D7A7D5) (Shutdown)
        iPhone 6s Plus (6030E33B-DE97-41A6-A961-6C05DEA2EA34) (Shutdown)
        iPhone 7 (0F1EE195-BB50-44D3-B87C-DB914196BB68) (Shutdown)
        iPhone 7 Plus (42FDB489-30D3-4BEE-82F1-D6BCA84019F2) (Shutdown)
        iPhone 8 (62895939-A322-4F3D-8D4E-8D8F3F44B98E) (Shutdown)
        iPhone 8 Plus (79D7D0A1-03CE-425D-A714-13CE8E62BCB3) (Shutdown)
        iPhone SE (82AC6B87-D98E-46A2-BE34-7F148F179796) (Shutdown)
        iPhone X (FEA0BBCA-91C3-4EE3-A49A-7EE2BC4382A4) (Shutdown)
        My-iPhoneX (A2E78F04-CB1B-4BCE-8BF3-8EA1B14930E5) (Shutdown)
        iPad Air (6F05FAB3-7094-485E-B518-CE6EC1D46D54) (Shutdown)
        iPad Air 2 (2A075B9A-35B3-410D-8D18-308A94F49F1D) (Shutdown)
        iPad (5th generation) (879A193F-2AF3-4446-BB63-095AE6C9C3E6) (Shutdown)
        iPad Pro (9.7-inch) (025D91DC-43CE-4497-A672-B57857BF6E68) (Shutdown)
        iPad Pro (12.9-inch) (2D1C41EA-5F2E-493F-98C8-29FCCDB35D0F) (Shutdown)
        iPad Pro (12.9-inch) (2nd generation) (96467014-EDC9-47EE-84FE-29AB7817B742) (Shutdown)
        iPad Pro (10.5-inch) (47BEFF82-F240-4105-868D-CA4C8EE3BF29) (Shutdown)
    -- tvOS 11.4 --
        Apple TV (E3696606-A26C-4BCE-9CC3-1DC99B148ED3) (Shutdown)
        Apple TV 4K (087290EA-40C9-4EEC-8A80-9D0A92378FA5) (Shutdown)
        Apple TV 4K (at 1080p) (71014E88-3FEF-450A-B315-3C224271401A) (Shutdown)
    -- watchOS 4.3 --
        Apple Watch - 38mm (7914DF5F-9810-4995-908F-1BABBAE02670) (Shutdown)
        Apple Watch - 42mm (A335D9E6-7974-45F6-B47D-3747FA9BD09E) (Shutdown)
        Apple Watch Series 2 - 38mm (7FBCB06A-EE99-4C8F-BDD2-870EC5275EF0) (Shutdown)
        Apple Watch Series 2 - 42mm (806DDCC1-588A-455D-AA1A-16F5E5931077) (Shutdown)
        Apple Watch Series 3 - 38mm (DF16B352-301E-4221-81CA-2869A1F9B527) (Shutdown)
        Apple Watch Series 3 - 42mm (85C06E5F-3E1A-4BC4-AECB-4EA0C88D8F09) (Shutdown)
    == Device Pairs ==
    BE73638A-71E6-41F2-A1EA-3372E898F1B0 (active, disconnected)
        Watch: Apple Watch Series 2 - 38mm (7FBCB06A-EE99-4C8F-BDD2-870EC5275EF0) (Shutdown)
        Phone: iPhone 7 (0F1EE195-BB50-44D3-B87C-DB914196BB68) (Shutdown)
    E17C2241-7367-4F02-AC44-54542EDBC936 (active, disconnected)
        Watch: Apple Watch Series 2 - 42mm (806DDCC1-588A-455D-AA1A-16F5E5931077) (Shutdown)
        Phone: iPhone 7 Plus (42FDB489-30D3-4BEE-82F1-D6BCA84019F2) (Shutdown)
    A463C9D5-E753-46F8-9493-D1A3E3BDCAA1 (active, disconnected)
        Watch: Apple Watch Series 3 - 38mm (DF16B352-301E-4221-81CA-2869A1F9B527) (Shutdown)
        Phone: iPhone 8 (62895939-A322-4F3D-8D4E-8D8F3F44B98E) (Shutdown)
    7A7B90CE-9B4F-41A6-8721-C7457E9F4A4E (active, disconnected)
        Watch: Apple Watch Series 3 - 42mm (85C06E5F-3E1A-4BC4-AECB-4EA0C88D8F09) (Shutdown)
        Phone: iPhone 8 Plus (79D7D0A1-03CE-425D-A714-13CE8E62BCB3) (Shutdown)

There are lots of bits of code here because it requires output logs.

Posts: 1

Participants: 1

Read full topic

IonChange not working in ion segment

$
0
0

@Gokul15 wrote:

(ionChange) is not working in ion-segment-button …No function is called when the event is fired!?
Anybody have idea about this issue??
Thanks …

Posts: 1

Participants: 1

Read full topic

Ion-cancel is not working in searchbar

$
0
0

@anujsinghwd wrote:

Template Code -

<ion-toolbar>
    <ion-searchbar (ionInput)="filter($event)" (ionCancel)="onCancelSearch($event)" placeholder="Code">
    </ion-searchbar>
  </ion-toolbar>

.ts Code -

onCancelSearch(event){
    console.log('Not working..')
  }

In the above code onCancelSearch Not Working in Android

Posts: 1

Participants: 1

Read full topic

App got rejected on the App Store due to "Minimum Functionality"

$
0
0

@kennyalmendral wrote:

So it’s my first time to submit an app to the Apple App Store… But they came with the ff. response:

Guideline 4.2.2 - Design - Minimum Functionality

We noticed that your app only includes links, images, or content aggregated from the Internet with limited or no native iOS functionality. Although this content may be curated from the web specifically for your users, since it does not sufficiently differ from a mobile web browsing experience, it is not appropriate for the App Store.

There’s really no additional functionality that needed to be added to the app in my opinion… Anyone else experienced the same? If so, what did you do? Or what “native” iOS features did you implement?

Thanks in advance… Anyways, here’s the screenshots of the app:

Posts: 1

Participants: 1

Read full topic


Windows 10 like side menu

$
0
0

@indrekm2gi wrote:

Hi!
I’m trying to create a menu like Windows 10 start-menu.
Any ideas?
I tried in this way, but didn’t find how to shift the menu baseline to right.

<ion-menu [content]="content" persistent="true">
    <ion-content ngClass="sidebar">

When user clicks hamburger button then menu is extended and shows icon texts.

Posts: 1

Participants: 1

Read full topic

How to return to apps after inappbrowser use _self webview

$
0
0

@mhtan88 wrote:

I previously using _blank with inappbrowser, but found out it got problem to load master card 3d security sms webpage. Therefore i tried to use _self webview. No problem. But now, i have problem to return apps. May i know how to return to apps? Or any way to use _blank but using webview instead of inappbrowser?

Posts: 1

Participants: 1

Read full topic

Ionic 4 Form Validation?

$
0
0

@Dunny wrote:

Hi,

Does anyone have an example of using Form Validation with Ionic 4?

I’m using the Angular 6 ReactiveFormsModule but the styling doesn’t look good with Ionic 4.

Many Thanks

Posts: 1

Participants: 1

Read full topic

Ion-list inside a grid col has no height

$
0
0

@donniekerr wrote:

I have a child list component inside a column in a grid. The list has no height. I want it to full the full height of the page.

The ion-content inside the child seems to have no height. The list itself is still there and has height. If I remove the child ion-content, the list appears ok, but I assume it won’t be scrollable on smaller devices.

What is the recommended best practice for nesting components to get full width and height of parent containers?

Thanks,
Donnie

<ion-content padding>
  <ion-grid>
    <ion-row>
      <ion-col col-4>
        <list-sections></list-sections>
      </ion-col>
      <ion-col col-4>

      </ion-col>
      <ion-col col-4>

      </ion-col>
    </ion-row>
    
  </ion-grid>
</ion-content>

<ion-content>

  <ion-list> 
    <button ion-item *ngFor="let item of items">
      <ion-icon item-start></ion-icon>
      {{item.title}}
      <div class="item-note" item-end>
        {{item.note}}
      </div>
    </button>
  </ion-list>

</ion-content>

Posts: 1

Participants: 1

Read full topic

Easiest way to create a subscription provider?

$
0
0

@freqsc wrote:

I would like to create a simple service that listens to accelerometer data. How can I subscribe to these values from a page?

This is my page:

import { Component } from '@angular/core';
import { NavController } from 'ionic-angular';
import { AccelerometerProvider } from '../../providers/accelerometer/accelerometer';

@Component({
  selector: 'page-home',
  templateUrl: 'home.html'
})
export class HomePage {

  constructor(public navCtrl: NavController, private accelerometer: AccelerometerProvider) {

  }

}

and this is my service:

import { Injectable } from '@angular/core';
import { DeviceMotion, DeviceMotionAccelerationData } from '@ionic-native/device-motion';
import { Observable } from 'rxjs/Observable';

@Injectable()
export class AccelerometerProvider {

  constructor(private deviceMotion: DeviceMotion) {
    console.log('Hello AccelerometerProvider Provider');
  }

  start() {
    this.deviceMotion.watchAcceleration().subscribe((acceleration: DeviceMotionAccelerationData) => {
      let x = acceleration.x;
      let y = acceleration.y;
      let z = acceleration.z;
    });
  }

}

What I want is just have access to x, y, z values from my page, each time a new subscription comes.
I suppose it is a n ‘observable’ thing but I am fairly new to this technology. I would appreciate any help.

Posts: 1

Participants: 1

Read full topic

Viewing all 71027 articles
Browse latest View live


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