Skip to content

Instantly share code, notes, and snippets.

View coolvasanth's full-sized avatar

coolvasanth

  • Bengaluru
View GitHub Profile
@coolvasanth
coolvasanth / gist:71a66aa818ae2a62b2c31c919a7436d0
Last active April 7, 2020 12:51
Appium issue "null response was thrown sending an HTTP"
[ADB] Running 'C:\Users\212779003\AppData\Local\Android\sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell am force-stop ge.mediamanager.ionicapp'
[AndroidDriver] Getting a list of available webviews
[ADB] Running 'C:\Users\212779003\AppData\Local\Android\sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell cat /proc/net/unix'
[AndroidDriver] Not checking whether webviews have active pages; use the 'ensureWebviewsHavePages' cap to turn this check on
[AndroidDriver] Found webviews: []
[AndroidDriver] Available contexts: ["NATIVE_APP"]
[W3C (8d1973c8)] Responding to client with driver.closeApp() result: null
[HTTP] <-- POST /wd/hub/session/8d1973c8-eaf0-4074-900d-35fffbddf691/appium/app/close 200 1323 ms - 14
[HTTP]
[HTTP] --> DELETE /wd/hub/session/8d1973c8-eaf0-4074-900d-35fffbddf691
@coolvasanth
coolvasanth / Error.html
Created February 5, 2020 14:17
Error while starting the session Appium
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="description" content="My Company Captcha Page">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://static.mycompany.com/captcha/images/apple-touch-icon-72px.png" rel="apple-touch-icon-precomposed" sizes="72x72" />
<link rel="preconnect" href="https://static.mycompany.com" />
Before starting the push notifications in Ionic 2 please have a look at the official documentation of phonegap-push-plugin.
Here is the link for same.
(https://github.com/phonegap/phonegap-plugin-push/blob/master/docs/PAYLOAD.md#notification-vs-data-payloads)
Everything that I will be writting is choosen from above document but with much easier way.
Look at the below code in android scenario:(choosen from https://ionicframework.com/docs/native/push/)
//in src/app/app.component.ts
@coolvasanth
coolvasanth / ionic2_upload_file_from_google_drive
Created August 27, 2017 05:59
Uploading a file from google drive/cloud application into your server Ionic, Hybrid app development.
//You need to use html input type file for this purpose.
// INPUT TYPE FILE GIVES A WEIRD LOOK FOR APP SO I HAVE
//STYLED IT LIKE BELOW.
//the html code is as below ex home.html
<label ion-button for="uploadResume" block style="background-color: #16a085;color: white;" color="secondary">Choose Resume</label>
<input style="display: none;" type="file" name="" id="uploadResume" (change)="OnResumeSelect($event)">
@coolvasanth
coolvasanth / uploadingvideo.txt
Created April 25, 2017 07:36
uploading video which is captured from device to server via API (works both on android and ios)
//install media capture, file chooser, file transfer, camera plugins from ionic 2 native plaugins and don't forget to add providers in
app.component.ts
import { Component } from '@angular/core';
import { NavController, NavParams,ActionSheetController } from 'ionic-angular';
import { MediaCapture, MediaFile, CaptureError, CaptureImageOptions,CaptureVideoOptions } from '@ionic-native/media-capture';
import { Camera, CameraOptions } from '@ionic-native/camera';
import { Transfer, FileUploadOptions, TransferObject } from '@ionic-native/transfer';
import { FileChooser } from '@ionic-native/file-chooser';
@coolvasanth
coolvasanth / uploadingresume.txt
Last active April 3, 2020 05:40
choosing .jpg,.pdf,.docs etc files from galley and uploading it to server via your API using IONIC 2. (DOESN'T WORK ON IOS)
// Install file chooser and file transfer API from ionic 2 and import them into your page.ts. and don't forget to add providers in
app.component.ts
import { Component } from '@angular/core';
import { NavController, NavParams} from 'ionic-angular';
import { Home } from '../../homemodule/home';
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import { UserProfileService } from '../../services/login.service';
@coolvasanth
coolvasanth / takepictureandupload.txt
Last active June 29, 2021 01:02
pick image from gallery or from camera and upload it to server via API, ionic 2
//install camera, file trnasfer plugin from ionic native and it's providers in app.component.ts. then only you can use thse codes in your .ts file.
presentActionSheet() {
let actionSheet = this.actionSheetCtrl.create({
title: 'Pick your profile photo',
buttons: [
{
text: 'From Gallery',