profile
viewpoint
Vahid Najafi vahidvdn Sazmand Iran, Tabriz http://www.sazmand.com Full stack developer | Co-founder of Sazmand

vahidvdn/nativescript-sazmand-version 4

NativeScript App Version (nativescript-sazmand-version)

vahidvdn/ngx-tab 3

An angular tab module

vahidvdn/Simple-App-NativeScript 2

A very simple application with nativescript to demonstrate it's truly native ui

vahidvdn/NativeScript 1

NativeScript is an open source framework for building truly native mobile apps with JavaScript. Use web skills, like Angular, FlexBox and CSS, and get native UI and performance on iOS and Android.

vahidvdn/angular-vs-repeat 0

Virtual Scroll for AngularJS ngRepeat directive

vahidvdn/BEMCheckBox 0

Tasteful Checkbox for iOS. (Check box)

vahidvdn/code-samples 0

Find code samples and building blocks for your NativeScript app in the Marketplace

vahidvdn/CodeIgniter 0

Open Source PHP Framework (originally from EllisLab)

vahidvdn/emojione 0

EmojiOne™ is the open emoji standard. #iwantemojione

vahidvdn/ionic 0

Advanced HTML5 mobile development framework and SDK. Build incredible mobile apps with web technologies you already know and love. Best friends with AngularJS.

issue commentNativeScript/NativeScript

Save external image to gallery

After a lot of searching, I was able to handle it with nativescript-donwloader plugin and some native codes:

// filePath is something like this: http://domain.com/image.png
downloadImg(filePath) {

    let path = android.os.Environment.getExternalStoragePublicDirectory(android.os.Environment.DIRECTORY_DOWNLOADS);
    path = path.getAbsolutePath();

    const imageDownloaderId = this.downloader.createDownload({
      url:filePath,
      path: path
    });

    this.downloader.start(imageDownloaderId, (progressData: ProgressEventData) => {
        // console.log(`Progress : ${progressData.value}%`);
        // console.log(`Current Size : ${progressData.currentSize}%`);
        // console.log(`Total Size : ${progressData.totalSize}%`);
        // console.log(`Download Speed in bytes : ${progressData.speed}%`);
    })
    .then((completed: DownloadEventData) => {
        console.log(`Image : ${completed.path}`);
        this.addPicToGallery(completed.path);
    })
    .catch(error => {
        // console.log(error.message);
    });

}

addPicToGallery(photoPath) {
    let mediaScanIntent = new android.content.Intent(android.content.Intent.ACTION_MEDIA_SCANNER_SCAN_FILE);
    let f = new java.io.File(photoPath);
    var contentUri = android.net.Uri.fromFile(f);
    mediaScanIntent.setData(contentUri);
    let context = androidApp.context;
    context.sendBroadcast(mediaScanIntent);
    let toast = Toast.makeText("Photo saved successfully.", "long");
    toast.show();
}

It would be really nice if there is a nativescripty way of doing it.

vahidvdn

comment created time in 2 days

startedNathanaelA/nativescript-permissions

started time in 2 days

issue closedtriniwiz/nativescript-downloader

Failed to run on android after adding plugin

After adding the plugin, I got the following errors while running the app:

Execution failed for task ':app:mergeDebugResources'.
Could not find aapt2-windows.jar (com.android.tools.build:aapt2:3.5.1-5435860).
Searched in the following locations:
    https://dl.google.com/dl/android/maven2/com/android/tools/build/aapt2/3.5.1-5435860/aapt2-3.5.1-5435860-windows.jar

closed time in 2 days

vahidvdn

issue commenttriniwiz/nativescript-downloader

Failed to run on android after adding plugin

I was able to solve it by this.

vahidvdn

comment created time in 2 days

issue openedtriniwiz/nativescript-downloader

Failed to run on android after adding plugin

After adding the plugin, I got the following errors while running the app:

Execution failed for task ':app:mergeDebugResources'.
Could not find aapt2-windows.jar (com.android.tools.build:aapt2:3.5.1-5435860).
Searched in the following locations:
    https://dl.google.com/dl/android/maven2/com/android/tools/build/aapt2/3.5.1-5435860/aapt2-3.5.1-5435860-windows.jar

created time in 3 days

issue openedtriniwiz/nativescript-downloader

Ability to save to the gallery

Is there any possibility to download the image to the gallery?

created time in 3 days

issue openedNativeScript/NativeScript

Save external image to gallery

Is your feature request related to a problem? Please describe. I want to get a photo from a URL (like www.domain.com/mypic.png) and save it in my gallery. I searched a lot but found nothing. Any idea how to do it on Android?

created time in 3 days

issue openedbcit-ci/CodeIgniter

Form validation is not working with PUT request directly

I use config file for setting rules for my validations. This works with POST request:

$this->form_validation->run('changePassword');

But when the request method is PUT, it doesn't work and I have to set the following before validation:

$this->form_validation->set_data($this->req);

Is there any way in order to properly handle the validation in the same way for all request methods?

created time in 19 days

startedmsywensky/nativescript-phone

started time in 19 days

startedSoCreate/angular-playground

started time in a month

issue commentNativeScript/NativeScript

Implement CSS Box Shadow

@rigor789 Thanks. I think this is the most favorite feature that almost all of the nativescripters really love it and waiting for it.

lscown

comment created time in a month

issue commentNativeScript/NativeScript

Implement CSS Box Shadow

@NathanWalker Any idea in order to make this work for both iOS and Android? (Since there is a new team and maybe new roadmaps)

lscown

comment created time in a month

startedHameds/IranCountryDivisions

started time in a month

issue closedPeterStaev/nativescript-purchase

Products list is empty

Hi. I have the following implementation. But the products list is empty. (I've submitted my app as a beta release at Google Play and added a product id)

main.ts

...
platformNativeScriptDynamic().bootstrapModule(AppModule);
purchase.init(['prod_purchase']);

items.componet.ts

purchase.getProducts().then((products: Array<Product>) => {
    // result: []
    alert("Products: "+ JSON.stringify(products));
}

Any idea?

closed time in a month

vahidvdn

issue commentPeterStaev/nativescript-purchase

Products list is empty

There was a problem with Google Play console. It's working now. Thanks.

vahidvdn

comment created time in a month

issue commentPeterStaev/nativescript-purchase

Products list is empty

@PeterStaev I tested it but still the same problem. (I'm not sure that I can run the project from the cli or I should submit a new version in Google Play. Can I just run the app or I should build a production version and submit it in Google Play?)

vahidvdn

comment created time in a month

issue commentPeterStaev/nativescript-purchase

Products list is empty

@PeterStaev I use getProducts in a button click event. But I will try what you mentioned to see if it's working or not. Thanks.

vahidvdn

comment created time in a month

issue openedPeterStaev/nativescript-purchase

Products list is empty

Hi. I have the following implementation. But the products list is empty. (I've submitted my app as a beta release at Google Play and added a product id)

main.ts

...
platformNativeScriptDynamic().bootstrapModule(AppModule);
purchase.init(['prod_purchase']);

items.componet.ts

purchase.getProducts().then((products: Array<Product>) => {
    // result: []
    alert("Products: "+ JSON.stringify(products));
}

Any idea?

created time in a month

pull request commentarialdomartini/Back-End-Developer-Interview-Questions

Answer of one of the questions

@arialdomartini I think this is a better approach too.

vahidvdn

comment created time in 2 months

pull request commentarialdomartini/Back-End-Developer-Interview-Questions

Answer of one of the questions

@arialdomartini Sure. You're welcome.

vahidvdn

comment created time in 2 months

startedspencerlambert/mysql-events

started time in 2 months

startedj3k0/cordova-plugin-purchase

started time in 2 months

startedEddyVerbruggen/nativescript-admob

started time in 2 months

issue commentPeterStaev/nativescript-purchase

expose getPurchases method

Hi @PeterStaev Sorry for the pinging. Why should we pass the product ids to the init method? Maybe they are not static and we add more products from google play developer console.

vahidvdn

comment created time in 2 months

issue closedPeterStaev/nativescript-purchase

expose getPurchases method

As you know, there is a getPurchases method to check if a product has already purchased or not. For example if the app is removed by the user, we can use this method to ensure that whether the product has already purchased or not. Or is there any other method to do this?

closed time in 2 months

vahidvdn

issue commentPeterStaev/nativescript-purchase

expose getPurchases method

@PeterStaev Thank you for detailed descriptions. Now I understood the solution.

Let me sum up the scenario. When the app gets opened, first I call restorePurchases to set up my local storage. (As I call this method, the transactionUpdatedEvent get fired and I can determine the state of my local storage and set signed token in order to verify the purchase in the server later. As I remember it's called dataSignature in Transaction type )

Then based on my local storage value, I decide to show the product list to the user or send my request to get the data. (And in server, before returning data, I should request to Google Play servers in orderr to verify the purchase)

Is it true?

vahidvdn

comment created time in 2 months

issue commentPeterStaev/nativescript-purchase

expose getPurchases method

@PeterStaev I'm still a bit confused. As I know restorePurchases() method is for refunding the purchase (giving back the money). Isn't it? What is the relation between refunding and the thing I want to do? (The thing I want to know, the status of the purchase, if the user reinstalls the app which leads the locally saved data to get removed.)

vahidvdn

comment created time in 2 months

issue commentPeterStaev/nativescript-purchase

expose getPurchases method

Or even for checking the status of subscription (to see if it's not expired)

vahidvdn

comment created time in 2 months

issue openedPeterStaev/nativescript-purchase

expose getPurchases method

As you know, there is a getPurchases method to check if a product has already purchased or not. For example if the app is removed by the user, we can use this method to ensure that whether the product has already purchased or not. Or is there any other method to do this?

created time in 2 months

pull request commentYermo/nativescript-mapbox

The mother of all pull requests.

@Yermo When will this be available through npm?

Yermo

comment created time in 3 months

startedcipchk/ngx-countdown

started time in 3 months

issue commentNativeScript/NativeScript

Android: Crash with "markingMode: none" + navigation + backgroundColor change (NS 5.4 / 6.0)

@jpierront This is fixed as mentioned here.

jpierront

comment created time in 3 months

issue commentmaciejtreder/ng-toolkit

How to fix “ReferenceError: window is not defined” error in angular 6 universal server.js

@KamranTaghaddos Of course, you can send a pull request to the 3rd party library. As I did here.

gitulaga

comment created time in 3 months

issue closedPeterStaev/nativescript-purchase

Can not compile on Windows machine

When I want to run:

grunt compile

I get the following errors:

Running "compile" task

Running "clean:build" (clean) task
>> 0 paths cleaned.

Running "exec:tsCompile" (exec) task
>> '.' is not recognized as an internal or external command,
>> operable program or batch file.
>> Exited with code: 1.
>> Error executing child process: Error: Process exited with code 1.
Warning: Task "exec:tsCompile" failed. Use --force to continue.

Aborted due to warnings.

Normally I can solve this error in Windows, but here you use grunt for the build process and I don't know what to do with grunt to make it work. Any idea?

closed time in 3 months

vahidvdn

issue commentPeterStaev/nativescript-purchase

Can not compile on Windows machine

Thanks @PeterStaev I was able to change it to version 28 and make it work. And one more question. Is this library implemented Google's in-app billing version 3 method?

vahidvdn

comment created time in 3 months

issue commentPeterStaev/nativescript-purchase

Can not compile on Windows machine

@PeterStaev I've installed the other versions of android SDK. Is there any chance to let it compile with my own version of SDK?

vahidvdn

comment created time in 3 months

issue commentPeterStaev/nativescript-purchase

Can not compile on Windows machine

Hey @PeterStaev I found them in gruntfile.js and changed the following:

cmd: "./node_modules/.bin/tsc --project tsconfig.json --outDir " + localConfig.outDir
cmd: "./node_modules/.bin/tslint --project tsconfig.json --type-check"

To:

cmd: '"node_modules/.bin/tsc" --project tsconfig.json --outDir ' + localConfig.outDir
cmd: '"node_modules/.bin/tslint" --project tsconfig.json --type-check'

According to what mentioned here

Also I changed this:

cmd: "./gradlew build",

To:

cmd: 'gradlew build',

Now I get the following error:

BUILD FAILED

Total time: 6 mins 47.467 secs
>> FAILURE: Build failed with an exception.
>>
>> * What went wrong:
>> A problem occurred configuring project ':inappbillinghelper'.
>> > failed to find target with hash string 'android-22' in: C:\Android\android-sdk
>>
>> * Try:
>> Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
>> Exited with code: 1.
>> Error executing child process: Error: Process exited with code 1.
Warning: Task "exec:build_android_aar" failed. Use --force to continue.

Aborted due to warnings.

Any idea?

vahidvdn

comment created time in 3 months

issue openedPeterStaev/nativescript-purchase

Can not compile on Windows machine

When I want to run:

grunt compile

I get the following errors:

Running "compile" task

Running "clean:build" (clean) task
>> 0 paths cleaned.

Running "exec:tsCompile" (exec) task
>> '.' is not recognized as an internal or external command,
>> operable program or batch file.
>> Exited with code: 1.
>> Error executing child process: Error: Process exited with code 1.
Warning: Task "exec:tsCompile" failed. Use --force to continue.

Aborted due to warnings.

Normally I can solve this error in Windows, but here you use grunt for the build process and I don't know what to do with grunt to make it work. Any idea?

created time in 3 months

push eventvahidvdn/nativescript-purchase-cafebazaar

Vahid Najafi

commit sha 3fdfd7e48e5c34091f9f2eaa62de2f496aadab35

Update InAppBillingHelper.java

view details

push time in 3 months

push eventvahidvdn/nativescript-purchase-cafebazaar

Vahid Najafi

commit sha ed026ab9bc6fd7024a205623bbc0f7b96a80e014

Change android manifest file based on cafebazaar docs Here is the migration docs: https://developers.cafebazaar.ir/en/docs/iab/migrate-google-play/

view details

push time in 3 months

fork vahidvdn/nativescript-purchase

:moneybag: A NativeScript plugin for making in-app purchases!

fork in 3 months

startedbitcoin/bitcoin

started time in 3 months

startedNotalib/nativescript-webview-ext

started time in 3 months

more